public override bool PrepareOptions()
        {
            if (!File.Exists(this.GffFile))
            {
                ParsingErrors.Add(string.Format("Gff file not exists {0}.", this.GffFile));
                return(false);
            }

            if (!File.Exists(this.FastaFile))
            {
                ParsingErrors.Add(string.Format("Fasta file not exists {0}.", this.FastaFile));
                return(false);
            }

            return(true);
        }
        public override bool PrepareOptions()
        {
            if (!File.Exists(this.MappingFile))
            {
                ParsingErrors.Add(string.Format("Mapping file not exists {0}.", this.MappingFile));
                return(false);
            }

            if (!File.Exists(this.InputFile))
            {
                ParsingErrors.Add(string.Format("Input file not exists {0}.", this.InputFile));
                return(false);
            }

            return(true);
        }
        public override bool PrepareOptions()
        {
            if (!File.Exists(this.InputFile))
            {
                ParsingErrors.Add(string.Format("Input file not exists {0}.", this.InputFile));
                return(false);
            }

            //if (!File.Exists(this.BedFile))
            //{
            //  ParsingErrors.Add(string.Format("Bed file not exists {0}.", this.BedFile));
            //  return false;
            //}

            return(true);
        }
예제 #4
0
        public override bool PrepareOptions()
        {
            if (!File.Exists(this.ReferenceFile))
            {
                ParsingErrors.Add(string.Format("Reference file not exists {0}.", this.ReferenceFile));
                return(false);
            }

            if (!File.Exists(this.SampleFile))
            {
                ParsingErrors.Add(string.Format("Sample file not exists {0}.", this.SampleFile));
                return(false);
            }

            return(true);
        }
예제 #5
0
        public override bool PrepareOptions()
        {
            if (!Directory.Exists(this.InputDirectory))
            {
                ParsingErrors.Add(string.Format("Input directory not exists {0}.", this.InputDirectory));
            }

            var gvcffiles = GetGvcfFiles();

            if (gvcffiles.Length == 0)
            {
                ParsingErrors.Add(string.Format("No .g.vcf file found in directory {0}.", this.InputDirectory));
            }

            return(ParsingErrors.Count == 0);
        }
        public override bool PrepareOptions()
        {
            if (!Directory.Exists(this.InputDir))
            {
                ParsingErrors.Add(string.Format("Input directory not exists {0}.", this.InputDir));
            }

            CheckPattern(this.FilePattern, "File pattern");

            if (GetStatisticFiles().Count == 0)
            {
                ParsingErrors.Add(string.Format("Input directory doesn't contain bam statistic files: {0}", this.InputDir));
            }

            return(ParsingErrors.Count == 0);
        }
예제 #7
0
        public override bool PrepareOptions()
        {
            if (!"-".Equals(this.InputFile) && !File.Exists(this.InputFile))
            {
                ParsingErrors.Add(string.Format("Input file not exists {0}.", this.InputFile));
                return(false);
            }

            if (!File.Exists(this.GenomeFastaFile))
            {
                ParsingErrors.Add(string.Format("Genome fasta file not exists {0}.", this.GenomeFastaFile));
                return(false);
            }

            return(true);
        }
예제 #8
0
        public override bool PrepareOptions()
        {
            if (!File.Exists(this.InputFile))
            {
                ParsingErrors.Add(string.Format("Input file not exists {0}.", this.InputFile));
                return(false);
            }

            if (!string.IsNullOrEmpty(this.AffyAnnotationFile) && !File.Exists(this.AffyAnnotationFile))
            {
                ParsingErrors.Add(string.Format("Affymetrix annotation file not exists {0}.", this.AffyAnnotationFile));
                return(false);
            }

            return(true);
        }
        public override bool PrepareOptions()
        {
            var result = base.PrepareOptions();

            long value;

            if (OffsetStrings.Any(l => !long.TryParse(l, out value)))
            {
                ParsingErrors.Add(string.Format("Offsets error {0}.", OffsetStrings.Merge(",")));
            }

            foreach (var file in this.InputFiles)
            {
                if (!File.Exists(file))
                {
                    ParsingErrors.Add(string.Format("Input file not exists {0}.", file));
                }
            }

            if (!File.Exists(this.CoordinateFile))
            {
                ParsingErrors.Add(string.Format("Coordinate file not exists {0}.", this.CoordinateFile));
            }

            if (!string.IsNullOrEmpty(this.FastaFile) && !File.Exists(this.FastaFile))
            {
                ParsingErrors.Add(string.Format("Fasta file not exists {0}.", this.FastaFile));
            }

            if (!string.IsNullOrEmpty(this.ExcludeXml) && !File.Exists(this.ExcludeXml))
            {
                ParsingErrors.Add(string.Format("Exclude xml file not exists {0}.", this.ExcludeXml));
            }

            if (!string.IsNullOrEmpty(this.FastqFile) && !File.Exists(this.FastqFile))
            {
                ParsingErrors.Add(string.Format("Fastq file not exists {0}.", this.FastqFile));
            }

            if (this.OffsetStrings == null || this.OffsetStrings.Count == 0)
            {
                this.OffsetStrings = DEFAULT_Offsets.ToList();
            }

            return(result && ParsingErrors.Count == 0);
        }
예제 #10
0
        public override bool PrepareOptions()
        {
            if (null == GenomeFastaFile)
            {
                ParsingErrors.Add("Genome fasta file not defined.");
            }
            else if (!File.Exists(GenomeFastaFile))
            {
                ParsingErrors.Add(string.Format("Genome fasta file not exists {0}.", GenomeFastaFile));
            }
            else
            {
                Console.Out.WriteLine("#mpileup genome fasta: " + GenomeFastaFile);
            }

            return(ParsingErrors.Count == 0);
        }
        private bool PrepareOutputDirectory()
        {
            if (!Directory.Exists(this.CandidatesDirectory))
            {
                try
                {
                    Directory.CreateDirectory(this.CandidatesDirectory);
                }
                catch (Exception ex)
                {
                    ParsingErrors.Add(string.Format("Cannot create directory {0} : {1}", this.CandidatesDirectory, ex.Message));
                    return(false);
                }
            }

            return(true);
        }
예제 #12
0
        public override bool PrepareOptions()
        {
            if (!File.Exists(PeptideFile))
            {
                ParsingErrors.Add(string.Format("Peptide file not exists : {0}", PeptideFile));
            }

            foreach (var rawFile in RawFiles)
            {
                if (!File.Exists(rawFile))
                {
                    ParsingErrors.Add(string.Format("Raw file not exists : {0}", rawFile));
                }
            }

            return(ParsingErrors.Count == 0);
        }
        public override bool PrepareOptions()
        {
            foreach (var file in this.InputFiles)
            {
                if (!File.Exists(file))
                {
                    ParsingErrors.Add(string.Format("Input file not exists {0}.", file));
                }
            }

            if (!File.Exists(this.TargetSnpFile))
            {
                ParsingErrors.Add(string.Format("Target SNP file not exists {0}.", this.TargetSnpFile));
            }

            return(ParsingErrors.Count == 0);
        }
예제 #14
0
        public override bool PrepareOptions()
        {
            if (!Create)
            {
                CheckFile("Configuration file", InputFile);

                try
                {
                    new MultipleRaw2MgfOptions().LoadFromFile(InputFile);
                }
                catch (Exception ex)
                {
                    ParsingErrors.Add("Error to read configuration file: " + ex.Message);
                }
            }

            return(ParsingErrors.Count == 0);
        }
        public override bool PrepareOptions()
        {
            foreach (var file in InputFiles)
            {
                if (!File.Exists(file))
                {
                    ParsingErrors.Add(string.Format("Fastq file not exists {0}.", file));
                    return(false);
                }
            }

            if (string.IsNullOrEmpty(this.OutputFile))
            {
                this.OutputFile = InputFiles[0] + ".len";
            }

            return(true);
        }
예제 #16
0
        public override bool PrepareOptions()
        {
            if (!File.Exists(InputFile))
            {
                ParsingErrors.Add(string.Format("Input file not exists {0}.", InputFile));
            }

            try
            {
                new MapItemReader(0, 1).ReadFromFile(this.InputFile);
            }
            catch (Exception ex)
            {
                ParsingErrors.Add(string.Format("Error reading list file {0} : {1}", this.InputFile, ex.Message));
            }

            return(ParsingErrors.Count == 0);
        }
        public override bool PrepareOptions()
        {
            if (!File.Exists(this.InputFile))
            {
                ParsingErrors.Add(string.Format("Input file not exists {0}.", this.InputFile));
            }

            if (!File.Exists(this.NameCountMapFile))
            {
                ParsingErrors.Add(string.Format("Name/TotalCount map file not exists {0}.", this.NameCountMapFile));
            }

            if (!File.Exists(this.LengthFile))
            {
                ParsingErrors.Add(string.Format("Length file not exists {0}.", this.LengthFile));
            }

            return(ParsingErrors.Count == 0);
        }
        public override bool PrepareOptions()
        {
            if (!File.Exists(this.InputFile))
            {
                ParsingErrors.Add(string.Format("Input file not exists {0}.", this.InputFile));
            }

            if (!string.IsNullOrEmpty(this.CountFile) && !File.Exists(this.CountFile))
            {
                ParsingErrors.Add(string.Format("Count file not exists {0}.", this.CountFile));
            }

            if (!File.Exists(this.XmlFile))
            {
                ParsingErrors.Add(string.Format("Mapped smallRNA XML file not exists {0}.", this.XmlFile));
            }

            if (!File.Exists(this.InputFile))
            {
                ParsingErrors.Add(string.Format("Input file not exists {0}.", this.InputFile));
                return(false);
            }

            if (!string.IsNullOrEmpty(this.ExcludeFile) && !File.Exists(this.ExcludeFile))
            {
                ParsingErrors.Add(string.Format("Exclude file not exists {0}.", this.ExcludeFile));
            }

            if (ExcludeBySequence)
            {
                if (!File.Exists(this.CountFile))
                {
                    ParsingErrors.Add(string.Format("Count file not exists {0}.", this.CountFile));
                }

                if (!File.Exists(this.XmlFile))
                {
                    ParsingErrors.Add(string.Format("Mapped smallRNA XML file not exists {0}.", this.XmlFile));
                }
            }

            return(ParsingErrors.Count == 0);
        }
예제 #19
0
        public override bool PrepareOptions()
        {
            if (!File.Exists(this.TargetFile))
            {
                ParsingErrors.Add(string.Format("Target count xml file not exists {0}.", this.TargetFile));
            }

            if (!File.Exists(this.RefgeneFile))
            {
                ParsingErrors.Add(string.Format("Refgene file not exists {0}.", this.RefgeneFile));
            }

            if (!File.Exists(this.GenomeFastaFile))
            {
                ParsingErrors.Add(string.Format("Genome fasta file not exists {0}.", this.GenomeFastaFile));
            }

            return(ParsingErrors.Count == 0);
        }
        public override bool PrepareOptions()
        {
            if (!File.Exists(this.InputFile))
            {
                ParsingErrors.Add(string.Format("Input file not exists {0}.", this.InputFile));
            }

            if (!File.Exists(this.GeneLengthFile))
            {
                ParsingErrors.Add(string.Format("Gene length file not exists {0}.", this.GeneLengthFile));
            }

            if (!string.IsNullOrEmpty(this.SampleReadsFile) && !File.Exists(this.SampleReadsFile))
            {
                ParsingErrors.Add(string.Format("Sample reads file not exists {0}.", this.SampleReadsFile));
            }

            return(ParsingErrors.Count == 0);
        }
        public override bool PrepareOptions()
        {
            if (!File.Exists(this.InputFile))
            {
                ParsingErrors.Add(string.Format("Input file not exists {0}.", this.InputFile));
            }

            if (!string.IsNullOrEmpty(this.CountFile) && !File.Exists(this.CountFile))
            {
                ParsingErrors.Add(string.Format("Count file not exists {0}.", this.CountFile));
            }

            if (!string.IsNullOrEmpty(CategoryMapFile))
            {
                CheckFile("categoryMapFile", CategoryMapFile);
            }

            return(ParsingErrors.Count == 0);
        }
예제 #22
0
        private void CheckParameter(string optionName, ProgramConfig program, ParameterConfig paramset, string paramname, Func <AnnotationProcessorOptions, string> getFunc, Action <AnnotationProcessorOptions, string> setFunc)
        {
            var value = getFunc(this);

            value = paramset.GetParameter(paramname, value);
            if (string.IsNullOrEmpty(value))
            {
                ParsingErrors.Add(string.Format("{0} {1}. Or you can define the default value at {2}::{3}::{4} in configuration file {5}.",
                                                optionName,
                                                BaseSentenceBuilder.CreateBuiltIn().RequiredOptionMissingText,
                                                program.Name,
                                                paramset.Name,
                                                paramname,
                                                this.Config.ConfigFilename));
            }
            else
            {
                setFunc(this, value);
            }
        }
        public override bool PrepareOptions()
        {
            if (!File.Exists(this.InputFile))
            {
                ParsingErrors.Add(string.Format("Input file not exists {0}.", this.InputFile));
            }

            if (TitleParserUtils.FindByName(TitleType) == null)
            {
                if (!string.IsNullOrEmpty(this.TitleType) && !this.TitleType.ToLower().Equals("help"))
                {
                    ParsingErrors.Add(string.Format("Unknown title type {0}.", this.TitleType));
                }
                ParsingErrors.Add("  Those titles are valid:");
                (from t in TitleParserUtils.GetTitleParsers()
                 select t.FormatName).ToList().ForEach(m => ParsingErrors.Add("    " + m));
            }

            return(ParsingErrors.Count == 0);
        }
        public override bool PrepareOptions()
        {
            if (!File.Exists(this.ListFile))
            {
                ParsingErrors.Add(string.Format("List file not exists {0}.", this.ListFile));
            }
            else
            {
                var files = GetCountXmlFiles();
                foreach (var file in files)
                {
                    if (!File.Exists(file.File))
                    {
                        ParsingErrors.Add(string.Format("Count xml file not exists {0}.", file.File));
                    }
                }
            }

            return(ParsingErrors.Count == 0);
        }
예제 #25
0
        public override bool PrepareOptions()
        {
            if (!base.PrepareOptions())
            {
                return(false);
            }

            if (!string.IsNullOrEmpty(this.MapFile) && !File.Exists(this.MapFile))
            {
                ParsingErrors.Add(string.Format("Map file not exists {0}.", this.MapFile));
                return(false);
            }

            if (!CheckPattern(this.KeyRegex, "keyRegex"))
            {
                return(false);
            }

            return(true);
        }
        public override bool PrepareOptions()
        {
            if (!File.Exists(this.InputFile))
            {
                ParsingErrors.Add(string.Format("Input file not exists {0}.", this.InputFile));
                return(false);
            }

            try
            {
                GetFileReader();
            }
            catch (Exception ex)
            {
                ParsingErrors.Add(ex.Message);
                return(false);
            }

            return(true);
        }
        public override bool PrepareOptions()
        {
            if (!PrepareOutputDirectory())
            {
                return(false);
            }

            try
            {
                using (SAMFactory.GetReader(this.NormalFile)) { }
                using (SAMFactory.GetReader(this.TumorFile)) { }
            }
            catch (Exception ex)
            {
                ParsingErrors.Add(ex.Message);
                return(false);
            }

            if (this.ThreadCount >= 2)
            {
                Console.WriteLine("Checking chromosome names for thread mode ...");
                if (this.ChromosomeNames == null || this.ChromosomeNames.Count == 0)
                {
                    this.ChromosomeNames = SAMUtils.GetChromosomes(this.NormalFile);
                }

                foreach (var chr in this.ChromosomeNames)
                {
                    Console.WriteLine(chr);
                }
            }
            else
            {
                if (this.ChromosomeNames != null && this.ChromosomeNames.Count > 0)
                {
                    Console.Out.WriteLine("#mpileup chromosome names: " + this.ChromosomeNames.Merge(","));
                }
            }

            return(true);
        }
예제 #28
0
        public override bool PrepareOptions()
        {
            Console.WriteLine("BAM file...");

            base.PrepareOptions();

            foreach (var file in BamFiles)
            {
                if (!File.Exists(file))
                {
                    ParsingErrors.Add(string.Format("Bam file not exists : {0}", file));
                }
            }

            if (BamFiles.Count != BamNames.Count)
            {
                ParsingErrors.Add("Bam file count is not equals to the bam names.");
            }

            return(ParsingErrors.Count == 0);
        }
        public override bool PrepareOptions()
        {
            if (!File.Exists(this.InputFile))
            {
                ParsingErrors.Add(string.Format("Input file not exists {0}.", this.InputFile));
                return(false);
            }

            if (!Directory.Exists(this.OutputDirectory))
            {
                ParsingErrors.Add(string.Format("Directory not exists {0}.", this.OutputDirectory));
                return(false);
            }

            if (null == this.Categories)
            {
                this.Categories = DEFAULT_Categories;
            }

            return(true);
        }
예제 #30
0
 protected virtual void ValidateListFile()
 {
     if (!File.Exists(this.ListFile))
     {
         ParsingErrors.Add(string.Format("List file not exists {0}.", this.ListFile));
     }
     else
     {
         var files = (from l in File.ReadAllLines(this.ListFile)
                      where l.Trim().Length > 0
                      select l).ToList();
         foreach (var file in files)
         {
             var parts   = file.Split('\t');
             var curfile = parts.Length == 1 ? parts[0] : parts[1];
             if (!File.Exists(curfile))
             {
                 ParsingErrors.Add(string.Format("Count file not exists {0}.", curfile));
             }
         }
     }
 }