Beispiel #1
0
        /// <summary>
        /// executes the program
        /// </summary>
        protected override void ProgramExecution()
        {
            var transcriptPath = ConfigurationSettings.InputPrefix + ".transcripts.gz";
            var regulatoryPath = ConfigurationSettings.InputPrefix + ".regulatory.gz";
            var genePath       = ConfigurationSettings.InputPrefix + ".genes.gz";
            var intronPath     = ConfigurationSettings.InputPrefix + ".introns.gz";
            var mirnaPath      = ConfigurationSettings.InputPrefix + ".mirnas.gz";
            var siftPath       = ConfigurationSettings.InputPrefix + ".sift.dat";
            var polyphenPath   = ConfigurationSettings.InputPrefix + ".polyphen.dat";
            var peptidePath    = ConfigurationSettings.InputPrefix + ".peptides.gz";

            var renamer = ChromosomeRenamer.GetChromosomeRenamer(FileUtilities.GetReadStream(ConfigurationSettings.InputReferencePath));

            using (var transcriptReader = new VepTranscriptReader(transcriptPath))
                using (var regulatoryReader = new VepRegulatoryReader(regulatoryPath))
                    using (var geneReader = new VepGeneReader(genePath))
                        using (var mergedGeneReader = new VepCombinedGeneReader(ConfigurationSettings.InputMergedGenesPath))
                            using (var intronReader = new VepSimpleIntervalReader(intronPath, "intron", GlobalImportCommon.FileType.Intron))
                                using (var mirnaReader = new VepSimpleIntervalReader(mirnaPath, "miRNA", GlobalImportCommon.FileType.MicroRna))
                                    using (var peptideReader = new VepSequenceReader(peptidePath, "peptide", GlobalImportCommon.FileType.Peptide))
                                    {
                                        var converter = new NirvanaDatabaseCreator(transcriptReader, regulatoryReader, geneReader,
                                                                                   mergedGeneReader, intronReader, mirnaReader, peptideReader, renamer);

                                        converter.LoadData();
                                        converter.MarkCanonicalTranscripts(ConfigurationSettings.InputLrgPath);
                                        converter.CreateTranscriptCacheFile(ConfigurationSettings.OutputCacheFilePrefix);
                                        converter.CopyPredictionCacheFile("SIFT", siftPath, CacheConstants.SiftPath(ConfigurationSettings.OutputCacheFilePrefix));
                                        converter.CopyPredictionCacheFile("PolyPhen", polyphenPath, CacheConstants.PolyPhenPath(ConfigurationSettings.OutputCacheFilePrefix));
                                    }
        }
Beispiel #2
0
        /// <summary>
        /// loads all the genes in the specified file
        /// </summary>
        private List <MutableGene> LoadGenes(string genesPath, string description)
        {
            var genes = new List <MutableGene>();

            using (var reader = new VepGeneReader(genesPath))
            {
                if (_header == null)
                {
                    _header = reader.Header;
                }

                while (true)
                {
                    var gene = reader.Next();
                    if (gene == null)
                    {
                        break;
                    }

                    genes.Add(gene);
                }
            }

            var transcriptDataSource  = genes.First().TranscriptDataSource;
            int numGenesWithoutSymbol = GetNumGenesWithoutSymbol(description, genes);

            if (numGenesWithoutSymbol > 0 && transcriptDataSource == TranscriptDataSource.RefSeq)
            {
                ResolveMissingRefSeqGeneSymbols(description, genes);
            }

            return(genes);
        }
Beispiel #3
0
        /// <summary>
        /// constructor
        /// </summary>
        public NirvanaDatabaseCreator(VepTranscriptReader transcriptReader, VepRegulatoryReader regulatoryReader,
                                      VepGeneReader geneReader, VepCombinedGeneReader mergedGeneReader, VepSimpleIntervalReader intronReader,
                                      VepSimpleIntervalReader mirnaReader, VepSequenceReader peptideReader, ChromosomeRenamer renamer)
        {
            _transcriptReader = transcriptReader;
            _regulatoryReader = regulatoryReader;
            _geneReader       = geneReader;
            _mergedGeneReader = mergedGeneReader;
            _intronReader     = intronReader;
            _microRnaReader   = mirnaReader;
            _peptideReader    = peptideReader;
            _renamer          = renamer;

            _transcripts        = new List <VD.Transcript>();
            _regulatoryElements = new List <VD.RegulatoryElement>();
            _genes       = new List <MutableGene>();
            _mergedGenes = new List <MutableGene>();
            _introns     = new List <VD.SimpleInterval>();
            _microRnas   = new List <VD.SimpleInterval>();
            _peptideSeqs = new List <string>();
        }