public float produceFeatureInternal(BaseInformationRecords.BaseInformationOrBuilder record, int featureIndex) { assert (featureIndex >= 0 && featureIndex < MAX_GENOTYPES * 2 * 2) : "Only MAX_GENOTYPES*2*2 + 1 features"; if (featureIndex < MAX_GENOTYPES * 2) { // germline counts written first: if ((featureIndex % 2) == 1) { // odd featureIndices are forward strand: return getAllCounts(record, false, true).get(featureIndex / 2).forwardCount; } else { return getAllCounts(record, false, true).get(featureIndex / 2).reverseCount; } } else { // tumor counts written next: featureIndex -= MAX_GENOTYPES * 2; if ((featureIndex % 2) == 1) { // odd featureIndices are forward strand: return getAllCounts(record, true, true).get(featureIndex / 2).forwardCount; } else { return getAllCounts(record, true, true).get(featureIndex / 2).reverseCount; } } }
public float produceFeature(BaseInformationRecords.BaseInformationOrBuilder record, int featureIndex) { return normalize(produceFeatureInternal(record, featureIndex), 1); }
@Override public void mapFeatures(BaseInformationRecords.BaseInformationOrBuilder record, INDArray inputs, int indexOfRecord) { indices[0] = indexOfRecord; prepareToNormalize(record, indexOfRecord); for (int featureIndex = 0; featureIndex < numberOfFeatures(); featureIndex++) { indices[1] = featureIndex; inputs.putScalar(indices, produceFeature(record, featureIndex)); } }
@Override public void mapLabels(BaseInformationRecords.BaseInformationOrBuilder record, INDArray labels, int indexOfRecord) { indices[0] = indexOfRecord; for (int labelIndex = 0; labelIndex < numberOfLabels(); labelIndex++) { indices[1] = labelIndex; labels.putScalar(indices, produceLabel(record, labelIndex)); } }
public FeatureMapperV18() { super(new SimpleFeatureCalculator(true), new IndelFeatures(), new ReadIndexFeaturesFix(), new FractionDifferences4(), new MagnitudeFeatures2() ); } }
public FeatureMapperV13() { super(new SimpleFeatureCalculator(true), new IndelFeatures(), new ReadIndexFeatures(), new FractionDifferences3(), new MagnitudeFeatures2() ); } }
public FeatureMapperV16() { super(new SimpleFeatureCalculator(true), new IndelFeatures(), new ReadIndexFeatures(), new FractionDifferences4(), new MagnitudeFeatures2() ); } }
public FeatureMapperV17() { super(new SimpleFeatureCalculator(true), new IndelFeatures(), new ReadIndexFeatures(), new FractionDifferences4(), new MagnitudeFeatures2(), new GenomicPositionMapper() ); } }
public FeatureMapperV15() { super(new SimpleFeatureCalculator(true), new IndelFeatures(), new ReadIndexFeatures(), new FractionDifferences3(), new MagnitudeFeatures2(), new GenomicPositionMapper() ); } }
insertSize -> (float) Math.log10(insertSize)), new FractionDifferences4(), new MagnitudeFeatures2() ));
insertSize -> (float) Math.log10(insertSize)), new FractionDifferences4(), new MagnitudeFeatures2() ));
/** * Configure the feature mapper for a specific set of sbi files. This method accesses the properties of the reader. * * @param sbiProperties properties from an sbi reader. */ public void configure(Properties sbiProperties) { delegate = new NamingConcatFeatureMapper<>(new SimpleFeatureCalculator(true), new IndelFeatures(), new GenomicContextMapper(sbiProperties), new ReadIndexFeaturesFix(), new FractionDifferences4(), new MagnitudeFeatures2(), new DensityMapper("numVariationsInRead", 10, sbiProperties, baseInformationOrBuilder -> TraversalHelper.forAllSampleCounts(baseInformationOrBuilder, BaseInformationRecords.CountInfo::getNumVariationsInReadsList)), new DensityMapper("readMappingQuality.forward", 10, sbiProperties, baseInformationOrBuilder -> TraversalHelper.forAllSampleCounts(baseInformationOrBuilder, BaseInformationRecords.CountInfo::getReadMappingQualityForwardStrandList)), new DensityMapper("readMappingQuality.reverse", 10, sbiProperties, baseInformationOrBuilder -> TraversalHelper.forAllSampleCounts(baseInformationOrBuilder, BaseInformationRecords.CountInfo::getReadMappingQualityReverseStrandList)), new DensityMapper("baseQuality.forward", 10, sbiProperties, baseInformationOrBuilder -> TraversalHelper.forAllSampleCounts(baseInformationOrBuilder, BaseInformationRecords.CountInfo::getQualityScoresForwardStrandList)), new DensityMapper("baseQuality.reverse", 10, sbiProperties, baseInformationOrBuilder -> TraversalHelper.forAllSampleCounts(baseInformationOrBuilder, BaseInformationRecords.CountInfo::getQualityScoresReverseStrandList)) ); }
/** * Configure the feature mapper for a specific set of sbi files. This method accesses the properties of the reader. * * @param sbiProperties properties from an sbi reader. */ public void configure(Properties sbiProperties) { delegate = new NamingConcatFeatureMapper<BaseInformationRecords.BaseInformationOrBuilder>( new SimpleFeatureCalculator(true), new IndelFeatures(), new GenomicContextMapper(sbiProperties), new ReadIndexFeaturesFix(), new FractionDifferences4(), new MagnitudeFeatures2(), new DensityMapper("numVariationsInRead", 20, sbiProperties, baseInformationOrBuilder -> TraversalHelper.forSampleCounts(sampleIndex,baseInformationOrBuilder, BaseInformationRecords.CountInfo::getNumVariationsInReadsList)), new DensityMapper("readMappingQuality.forward", 10, sbiProperties, baseInformationOrBuilder -> TraversalHelper.forSampleCounts(sampleIndex,baseInformationOrBuilder, BaseInformationRecords.CountInfo::getReadMappingQualityForwardStrandList)), new DensityMapper("readMappingQuality.reverse", 10, sbiProperties, baseInformationOrBuilder -> TraversalHelper.forSampleCounts(sampleIndex,baseInformationOrBuilder, BaseInformationRecords.CountInfo::getReadMappingQualityReverseStrandList)), new DensityMapper("baseQuality.forward", 10, sbiProperties, baseInformationOrBuilder -> TraversalHelper.forSampleCounts(sampleIndex,baseInformationOrBuilder, BaseInformationRecords.CountInfo::getQualityScoresForwardStrandList)), new DensityMapper("baseQuality.reverse", 10, sbiProperties, baseInformationOrBuilder -> TraversalHelper.forSampleCounts(sampleIndex,baseInformationOrBuilder, BaseInformationRecords.CountInfo::getQualityScoresReverseStrandList)) ); }
new ReadIndexFeaturesFix(), new FractionDifferences4(), new MagnitudeFeatures2(), new DensityMapper("numVariationsInRead", 20, sbiProperties, baseInformationOrBuilder -> TraversalHelper.forAllSampleCounts(baseInformationOrBuilder, BaseInformationRecords.CountInfo::getNumVariationsInReadsList)),
new ReadIndexFeaturesFix(), new FractionDifferences4(), new MagnitudeFeatures2(), new DensityMapper("numVariationsInRead", 20, sbiProperties, baseInformationOrBuilder -> TraversalHelper.forAllSampleCounts(baseInformationOrBuilder, BaseInformationRecords.CountInfo::getNumVariationsInReadsList)),
new ReadIndexFeaturesFix(), new FractionDifferences4(), new MagnitudeFeatures2(), new DensityMapper("numVariationsInRead", 20, sbiProperties, baseInformationOrBuilder -> TraversalHelper.forAllSampleCounts(baseInformationOrBuilder, BaseInformationRecords.CountInfo::getNumVariationsInReadsList)),
new ReadIndexFeaturesFix(), new FractionDifferences4(), new MagnitudeFeatures2(), new DensityMapper("numVariationsInRead", 20, sbiProperties, baseInformationOrBuilder -> TraversalHelper.forAllSampleCounts(baseInformationOrBuilder, BaseInformationRecords.CountInfo::getNumVariationsInReadsList)),
new ReadIndexFeaturesFix(), new FractionDifferences4(), new MagnitudeFeatures2(), new DensityMapper("numVariationsInRead", 20, sbiProperties, baseInformationOrBuilder -> TraversalHelper.forAllSampleCounts(baseInformationOrBuilder, BaseInformationRecords.CountInfo::getNumVariationsInReadsList)),