Ejemplo n.º 1
0
        public void Clear()
        {
            SupplementaryAnnotationPosition = null;
            ReferenceName        = null;
            UcscReferenceName    = null;
            EnsemblReferenceName = null;
            VcfRefAllele         = null;
            VcfColumns           = null;
            ConservationScore    = null;
            CytogeneticBand      = null;
            VcfVariantId         = null;

            IsRefMinor                = false;
            IsSingletonRefSite        = false;
            IsReference               = false;
            IsRefNoCall               = false;
            IsStructuralVariant       = false;
            VcfReferenceBegin         = 0;
            VcfReferenceEnd           = 0;
            OverlapReferenceBegin     = 0;
            OverlapReferenceEnd       = 0;
            StrandBias                = null;
            JointSomaticNormalQuality = null;
            RecalibratedQuality       = null;
            CiPos                  = null;
            CiEnd                  = null;
            CopyNumber             = null;
            Depth                  = null;
            InternalCopyNumberType = VariantType.unknown;
            SvLength               = null;
            ColocalizedWithCnv     = false;

            AlternateAlleles?.Clear();
            _overlappingSupplementaryIntervals?.Clear();
        }
Ejemplo n.º 2
0
        public void AddCustomAnnotation(ISupplementaryAnnotationPosition sa)
        {
            // sanity check: SVs don't use supplementary annotations for now
            if (IsStructuralVariant)
            {
                return;
            }

            sa.SetIsAlleleSpecific(SuppAltAllele);

            if (SupplementaryAnnotationPosition == null)
            {
                SupplementaryAnnotationPosition = sa;
                return;
            }

            if (SupplementaryAnnotationPosition.CustomItems != null)
            {
                SupplementaryAnnotationPosition.CustomItems.AddRange(sa.CustomItems);
            }
            else
            {
                SupplementaryAnnotationPosition.CustomItems = sa.CustomItems;
            }
        }
Ejemplo n.º 3
0
        /// <summary>
        /// sets the supplementary annotation allele
        /// </summary>
        public void SetSupplementaryAnnotation(ISupplementaryAnnotationPosition sa)
        {
            // sanity check: SVs don't use supplementary annotations for now
            if (IsStructuralVariant)
            {
                return;
            }

            sa.SetIsAlleleSpecific(SuppAltAllele);

            SupplementaryAnnotationPosition = sa;
        }
Ejemplo n.º 4
0
        /// <summary>
        /// sets the supplementary annotation record for each allele in this record
        /// </summary>
        public void SetSupplementaryAnnotation(ISupplementaryAnnotationReader saReader)
        {
            // for ref variants, alternate alleles will be empty. We will need to pull the SA from reference position.
            // If this is a ref minor position, I will add an alt allele with the ref as alt and GMAF as ref
            if (IsReference)
            {
                // checking the index for refMinor using the index before actually going to disk
                IsRefMinor = saReader.IsRefMinor(VcfReferenceBegin);

                if (!IsRefMinor)
                {
                    return;
                }

                SupplementaryAnnotationPosition = saReader.GetAnnotation(VcfReferenceBegin);
                if (SupplementaryAnnotationPosition == null)
                {
                    return;
                }


                // if we have a ref minor, we do not care about ref no call
                IsRefNoCall = false;

                AlternateAlleles[0].AlternateAllele = AlternateAlleles[0].ReferenceAllele;// ref becomes alt for ref minor

                if (SupplementaryAnnotationPosition.GlobalMajorAllele != null)
                {
                    AlternateAlleles[0].ReferenceAllele = SupplementaryAnnotationPosition.GlobalMajorAllele;
                }

                AlternateAlleles[0].NirvanaVariantType = VariantType.SNV;
                AlternateAlleles[0].VepVariantType     = VariantType.SNV;
                AlternateAlleles[0].SuppAltAllele      = AlternateAlleles[0].AlternateAllele; // for SNVs there is nothing to reduce
                AlternateAlleles[0].VariantId          = _vid.Create(_renamer, EnsemblReferenceName, AlternateAlleles[0]);
                AlternateAlleles[0].SetSupplementaryAnnotation(SupplementaryAnnotationPosition);

                return;
            }

            foreach (var altAllele in AlternateAlleles)
            {
                var sa = saReader.GetAnnotation(altAllele.Start);
                if (sa != null)
                {
                    altAllele.SetSupplementaryAnnotation(sa);
                }
            }
        }
Ejemplo n.º 5
0
 /// <summary>
 /// copy constructor
 /// </summary>
 public VariantAlternateAllele(VariantAlternateAllele altAllele)
 {
     AlternateAllele               = altAllele.AlternateAllele;
     BreakEnds                     = altAllele.BreakEnds;
     ConservationScore             = altAllele.ConservationScore;
     CopyNumber                    = altAllele.CopyNumber;
     GenotypeIndex                 = altAllele.GenotypeIndex;
     _isForwardTranscriptDuplicate = altAllele._isForwardTranscriptDuplicate;
     _isReverseTranscriptDuplicate = altAllele._isReverseTranscriptDuplicate;
     IsStructuralVariant           = altAllele.IsStructuralVariant;
     IsSymbolicAllele              = altAllele.IsSymbolicAllele;
     NirvanaVariantType            = altAllele.NirvanaVariantType;
     ReferenceAllele               = altAllele.ReferenceAllele;
     Start         = altAllele.Start;
     End           = altAllele.End;
     SuppAltAllele = altAllele.SuppAltAllele;
     SupplementaryAnnotationPosition = altAllele.SupplementaryAnnotationPosition;
     VariantId      = altAllele.VariantId;
     VepVariantType = altAllele.VepVariantType;
 }
Ejemplo n.º 6
0
        public void AddCustomAnnotation(List <ISupplementaryAnnotationReader> saReaders)
        {
            if (IsReference)
            {
                foreach (var saReader in saReaders)
                {
                    var sa = saReader.GetAnnotation(VcfReferenceBegin);
                    if (sa == null)
                    {
                        continue;
                    }
                    if (SupplementaryAnnotationPosition != null)
                    {
                        SupplementaryAnnotationPosition.CustomItems.AddRange(sa.CustomItems);
                    }
                    else
                    {
                        SupplementaryAnnotationPosition = sa;
                    }
                }

                return;
            }

            foreach (var altAllele in AlternateAlleles)
            {
                foreach (var saReader in saReaders)
                {
                    var sa = saReader.GetAnnotation(altAllele.Start);

                    if (sa != null)
                    {
                        altAllele.AddCustomAnnotation(sa);
                    }
                }
            }
        }
Ejemplo n.º 7
0
 /// <summary>
 /// constructor
 /// </summary>
 public MockSupplementaryAnnotationReader(SupplementaryAnnotationPosition saPosition)
 {
     _saPosition        = saPosition;
     _referencePosition = saPosition.ReferencePosition;
     _isRefMinorAllele  = saPosition.IsRefMinorAllele;
 }