コード例 #1
0
 public void MergeAlleleSpecificAnnotation(AlleleSpecificAnnotation otherAsa)
 {
     foreach (var dataSource in DataSourceCommon.GetAllDataSources())
     {
         var index = DataSourceCommon.GetIndex(dataSource);
         if (HasDataSource(dataSource) && otherAsa.HasDataSource(dataSource))
         {
             Annotations[index].MergeAnnotations(otherAsa.Annotations[index]);
             break;
         }
         if (!HasDataSource(dataSource) && otherAsa.HasDataSource(dataSource))
         {
             DataSourceCommon.AddDataSource(dataSource, ref SaDataSourceFlag);
             Annotations[index] = otherAsa.Annotations[index];
         }
     }
 }
コード例 #2
0
        public static AlleleSpecificAnnotation Read(ExtendedBinaryReader reader)
        {
            var asa = new AlleleSpecificAnnotation {
                SaDataSourceFlag = reader.ReadByte()
            };

            foreach (var dataSource in DataSourceCommon.GetAllDataSources())
            {
                if (!asa.HasDataSource(dataSource))
                {
                    continue;
                }
                var supplementaryAnnotation = SupplementaryAnnotationFactory.CreateSupplementaryAnnotation(dataSource);
                supplementaryAnnotation.Read(reader);
                asa.Annotations[DataSourceCommon.GetIndex(dataSource)] = supplementaryAnnotation;
            }

            return(asa);
        }