Ejemplo n.º 1
0
        public CosmicTsvWriter(DataSourceVersion version, string outputDirectory, GenomeAssembly genomeAssembly, ISequenceProvider sequenceProvider)
        {
            Console.WriteLine(version.ToString());

            _writer = new SaTsvWriter(outputDirectory, version, genomeAssembly.ToString(),
                                      SaTsvCommon.CosmicSchemaVersion, InterimSaCommon.CosmicTag, InterimSaCommon.CosmicVcfTag, false, sequenceProvider, true);
        }
Ejemplo n.º 2
0
        public GnomadTsvWriter(DataSourceVersion version, string outputDirectory, GenomeAssembly genomeAssembly, ISequenceProvider sequenceProvider, string sequencingDataType)
        {
            Console.WriteLine(version.ToString());

            _writer = new SaTsvWriter(outputDirectory, version, genomeAssembly.ToString(),
                                      SaTsvCommon.SchemaVersion, _jsonKeyDictionary[sequencingDataType], null, true, sequenceProvider);
        }
Ejemplo n.º 3
0
        public CustomAnnoTsvWriter(DataSourceVersion version, string outputDirectory, GenomeAssembly genomeAssembly, bool isPositional, ISequenceProvider sequenceProvider)
        {
            Console.WriteLine(version.ToString());

            _writer = new SaTsvWriter(outputDirectory, version, genomeAssembly.ToString(),
                                      SaTsvCommon.CustomItemSchemaVersion, version.Name, null, !isPositional, sequenceProvider, true);
        }
Ejemplo n.º 4
0
        public TopMedTsvWriter(DataSourceVersion version, string outputFileName, GenomeAssembly genomeAssembly, ISequenceProvider sequenceProvider)
        {
            Console.WriteLine(version.ToString());

            _writer = new SaTsvWriter(outputFileName, version, genomeAssembly.ToString(),
                                      SaTsvCommon.SchemaVersion, InterimSaCommon.TopMedTag, null, true, sequenceProvider);
        }
Ejemplo n.º 5
0
        public ExacTsvWriter(DataSourceVersion version, string outputDirectory, GenomeAssembly genomeAssembly, ISequenceProvider sequenceProvider)
        {
            Console.WriteLine(version.ToString());

            _writer = new SaTsvWriter(outputDirectory, version, genomeAssembly.ToString(),
                                      SaTsvCommon.OneKgenSchemaVersion, InterimSaCommon.ExacTag, null, true, sequenceProvider);
        }
Ejemplo n.º 6
0
        public OnekgTsvWriter(DataSourceVersion version, string outputDirectory, GenomeAssembly genomeAssembly, ISequenceProvider sequenceProvider)
        {
            Console.WriteLine(version.ToString());

            _onekgWriter = new SaTsvWriter(outputDirectory, version, genomeAssembly.ToString(),
                                           SaTsvCommon.OneKgenSchemaVersion, InterimSaCommon.OneKgenTag, "AF1000G", true, sequenceProvider);

            _refMinorWriter = new SaMiscTsvWriter(outputDirectory, version, genomeAssembly.ToString(), InterimSaCommon.RefMinorTag, sequenceProvider);
        }
Ejemplo n.º 7
0
        public void Write_clinvar_basic()
        {
            var version = new DataSourceVersion("source1", "v1", DateTime.Now.Ticks, "description");

            using (var saStream = new MemoryStream())
                using (var indexStream = new MemoryStream())
                {
                    using (var saWriter = new NsaWriter(saStream, indexStream, version, GetSequenceProvider(), "clinvar",
                                                        false, true, SaCommon.SchemaVersion, false, true, false, 1024, GenomeAssembly.GRCh37, true))
                    {
                        saWriter.Write(GetClinvarItems());
                    }

                    saStream.Position    = 0;
                    indexStream.Position = 0;

                    using (var saReader = new NsaReader(saStream, indexStream, 1024))
                    {
                        Assert.Equal(GenomeAssembly.GRCh37, saReader.Assembly);
                        Assert.Equal(version.ToString(), saReader.Version.ToString());
                        saReader.PreLoad(ChromosomeUtilities.Chr1, new List <int> {
                            100, 101, 106
                        });
                        var annotations = saReader.GetAnnotation(100).ToList();

                        Assert.Equal("T", annotations[0].refAllele);
                        Assert.Equal("A", annotations[0].altAllele);
                        Assert.Equal(
                            "\"id\":\"RCV0001\",\"reviewStatus\":\"no assertion provided\",\"alleleOrigins\":[\"origin1\"],\"refAllele\":\"T\",\"altAllele\":\"A\",\"phenotypes\":[\"phenotype1\"],\"medGenIds\":[\"medgen1\"],\"omimIds\":[\"omim1\"],\"orphanetIds\":[\"orpha1\"],\"significance\":[\"significance\"],\"lastUpdatedDate\":\"0001-01-01\",\"pubMedIds\":[\"10024875684920\"]",
                            annotations[0].annotation);

                        annotations = saReader.GetAnnotation(101).ToList();
                        Assert.Equal("A", annotations[0].refAllele);
                        Assert.Equal("", annotations[0].altAllele);
                        Assert.Equal(
                            "\"id\":\"RCV00011\",\"variationId\":101,\"reviewStatus\":\"no assertion provided\",\"alleleOrigins\":[\"origin1\"],\"refAllele\":\"A\",\"altAllele\":\"-\",\"phenotypes\":[\"phenotype1\"],\"medGenIds\":[\"medgen1\"],\"omimIds\":[\"omim1\"],\"orphanetIds\":[\"orpha1\"],\"significance\":[\"significance\"],\"lastUpdatedDate\":\"0001-01-01\",\"pubMedIds\":[\"10024875684920\"]",
                            annotations[0].annotation);

                        saReader.PreLoad(ChromosomeUtilities.Chr2, new List <int> {
                            200, 205
                        });
                        var(refAllele, altAllele, annotation) = saReader.GetAnnotation(200).First();
                        Assert.Equal("G", refAllele);
                        Assert.Equal("A", altAllele);
                        Assert.NotNull(annotation);
                    }
                }
        }
Ejemplo n.º 8
0
 public MitoMapVarTsvWriter(DataSourceVersion version, string outputDirectory, string mitoMapDataType, ISequenceProvider sequenceProvider)
 {
     Console.WriteLine(version.ToString());
     _mitoMapVarWriter = new SaTsvWriter(outputDirectory, version, GenomeAssembly.rCRS.ToString(), SaTsvCommon.MitoMapSchemaVersion, mitoMapDataType, null, false, sequenceProvider, true);
 }
Ejemplo n.º 9
0
 public ClinvarTsvWriter(DataSourceVersion version, string outputDirectory, GenomeAssembly genomeAssembly, ISequenceProvider sequenceProvider) : this(new SaTsvWriter(outputDirectory, version, genomeAssembly.ToString(),
                                                                                                                                                                      SaTsvCommon.ClinvarSchemaVersion, InterimSaCommon.ClinvarTag, InterimSaCommon.ClinvarVcfTag, false, sequenceProvider, true))
 {
     Console.WriteLine(version.ToString());
 }
Ejemplo n.º 10
0
 public EvsTsvWriter(DataSourceVersion version, string outputDirectory, GenomeAssembly genomeAssembly, ISequenceProvider sequenceProvider) : this(new SaTsvWriter(outputDirectory, version, genomeAssembly.ToString(),
                                                                                                                                                                  SaTsvCommon.OneKgenSchemaVersion, InterimSaCommon.EvsTag, InterimSaCommon.EvsVcfTag, true, sequenceProvider))
 {
     Console.WriteLine(version.ToString());
 }