本文整理汇总了Java中htsjdk.tribble.annotation.Strand.decode方法的典型用法代码示例。如果您正苦于以下问题:Java Strand.decode方法的具体用法?Java Strand.decode怎么用?Java Strand.decode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类htsjdk.tribble.annotation.Strand
的用法示例。
在下文中一共展示了Strand.decode方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: helpCreateDataForTestGetBasesInWindowAroundReferenceAllele
import htsjdk.tribble.annotation.Strand; //导入方法依赖的package包/类
private static Object[] helpCreateDataForTestGetBasesInWindowAroundReferenceAllele(final String refAlelleBases,
final String altAlleleBases,
final String strand,
final int windowSizeInBases,
final int startPos,
final int endPos,
final String expected) {
return new Object[] {
Allele.create(refAlelleBases, true),
Allele.create(altAlleleBases),
Strand.decode(strand),
windowSizeInBases,
new ReferenceContext( refDataSourceHg19Ch3, new SimpleInterval("chr3", startPos, endPos) ),
expected
};
}
示例2: createGencodeFuncotationBuilderWithTrivialFieldsPopulated
import htsjdk.tribble.annotation.Strand; //导入方法依赖的package包/类
/**
* Creates a {@link GencodeFuncotationBuilder} with some of the fields populated.
* @param variant The {@link VariantContext} for the current variant.
* @param altAllele The alternate {@link Allele} we are currently annotating.
* @param gtfFeature The current {@link GencodeGtfGeneFeature} read from the input feature file.
* @param transcript The current {@link GencodeGtfTranscriptFeature} containing our {@code alternateAllele}.
* @return A trivially populated {@link GencodeFuncotationBuilder} object.
*/
private static GencodeFuncotationBuilder createGencodeFuncotationBuilderWithTrivialFieldsPopulated(final VariantContext variant,
final Allele altAllele,
final GencodeGtfGeneFeature gtfFeature,
final GencodeGtfTranscriptFeature transcript) {
final GencodeFuncotationBuilder gencodeFuncotationBuilder = new GencodeFuncotationBuilder();
final Strand strand = Strand.decode(transcript.getGenomicStrand().toString());
gencodeFuncotationBuilder.setRefAlleleAndStrand(variant.getReference(), strand)
.setHugoSymbol(gtfFeature.getGeneName())
.setNcbiBuild(gtfFeature.getUcscGenomeVersion())
.setChromosome(gtfFeature.getChromosomeName())
.setStart(variant.getStart());
// The end position is inclusive, so we need to make sure we don't double-count the start position (so we subtract 1):
gencodeFuncotationBuilder.setEnd(variant.getStart() + altAllele.length() - 1)
.setVariantType(getVariantType(variant.getReference(), altAllele))
.setTumorSeqAllele1(altAllele.getBaseString())
.setTumorSeqAllele2(altAllele.getBaseString())
.setGenomeChange(getGenomeChangeString(variant, altAllele, gtfFeature))
.setAnnotationTranscript(transcript.getTranscriptId())
.setTranscriptPos(
FuncotatorUtils.getTranscriptAlleleStartPosition(variant.getStart(), transcript.getStart(), transcript.getEnd(), strand)
)
.setOtherTranscripts(
gtfFeature.getTranscripts().stream().map(GencodeGtfTranscriptFeature::getTranscriptId).collect(Collectors.toList())
);
// Check for the optional non-serialized values for sorting:
// NOTE: This is kind of a kludge:
gencodeFuncotationBuilder.setLocusLevel( Integer.valueOf(gtfFeature.getLocusLevel().toString()) );
// Check for existence of Appris Rank and set it:
gencodeFuncotationBuilder.setApprisRank( getApprisRank( gtfFeature ) );
// Get the length of the transcript:
// NOTE: We add 1 because of genomic cordinates:
gencodeFuncotationBuilder.setTranscriptLength( transcript.getEnd() - transcript.getStart() + 1);return gencodeFuncotationBuilder;
}
示例3: createIntronFuncotation
import htsjdk.tribble.annotation.Strand; //导入方法依赖的package包/类
/**
* Create a {@link GencodeFuncotation} for a {@code variant} that occurs in an intron in the given {@code transcript}.
* @param variant The {@link VariantContext} for which to create a {@link GencodeFuncotation}.
* @param altAllele The {@link Allele} in the given {@code variant} for which to create a {@link GencodeFuncotation}.
* @param reference The {@link ReferenceContext} for the given {@code variant}.
* @param gtfFeature The {@link GencodeGtfGeneFeature} in which the given {@code variant} occurs.
* @param transcript The {@link GencodeGtfTranscriptFeature} in which the given {@code variant} occurs.
* @param referenceContext The {@link ReferenceContext} in which the given variant appears.
* @return A {@link GencodeFuncotation} containing information about the given {@code variant} given the corresponding {@code transcript}.
*/
private static GencodeFuncotation createIntronFuncotation(final VariantContext variant,
final Allele altAllele,
final ReferenceContext reference,
final GencodeGtfGeneFeature gtfFeature,
final GencodeGtfTranscriptFeature transcript,
final ReferenceContext referenceContext) {
// Setup the "trivial" fields of the gencodeFuncotation:
final GencodeFuncotationBuilder gencodeFuncotationBuilder = createGencodeFuncotationBuilderWithTrivialFieldsPopulated(variant, altAllele, gtfFeature, transcript);
// Determine the strand for the variant:
final Strand strand = Strand.decode( transcript.getGenomicStrand().toString() );
FuncotatorUtils.assertValidStrand(strand);
// Get the strand-corrected alleles from the inputs.
// Also get the reference sequence for the variant region.
// (spanning the entire length of both the reference and the variant, regardless of which is longer).
final Allele strandCorrectedRefAllele;
final Allele strandCorrectedAltAllele;
if ( strand == Strand.POSITIVE ) {
strandCorrectedRefAllele = variant.getReference();
strandCorrectedAltAllele = altAllele;
}
else {
strandCorrectedRefAllele = Allele.create(ReadUtils.getBasesReverseComplement( variant.getReference().getBases() ), true);
strandCorrectedAltAllele = Allele.create(ReadUtils.getBasesReverseComplement( altAllele.getBases() ), false);
}
final String referenceBases = FuncotatorUtils.getBasesInWindowAroundReferenceAllele(strandCorrectedRefAllele, strandCorrectedAltAllele, strand, referenceWindow, referenceContext);
// Set our reference sequence in the Gencode Funcotation Builder:
gencodeFuncotationBuilder.setReferenceContext( referenceBases );
// Set as default INTRON variant classification:
gencodeFuncotationBuilder.setVariantClassification(GencodeFuncotation.VariantClassification.INTRON);
// Set GC Content:
gencodeFuncotationBuilder.setGcContent( calculateGcContent( reference, gcContentWindowSizeBases ) );
// Need to check if we're within the window for splice site variants:
final GencodeGtfExonFeature spliceSiteExon = getExonWithinSpliceSiteWindow(variant, transcript, spliceSiteVariantWindowBases);
if ( spliceSiteExon != null ) {
// Set the variant classification:
gencodeFuncotationBuilder.setVariantClassification(GencodeFuncotation.VariantClassification.SPLICE_SITE)
.setSecondaryVariantClassification(GencodeFuncotation.VariantClassification.INTRON);
// In deletions we have added a base to the front because of VCF requirements, thus we add an
// offset of 1 to account for that:
// (TODO: come to think of it this is really bad, because we're tying our parsing / computations to a data format).
int offsetIndelAdjustment = 0;
if ( GATKVariantContextUtils.isDeletion(variant.getReference(), altAllele) ) {
offsetIndelAdjustment = 1;
}
gencodeFuncotationBuilder.setCodonChange(
FuncotatorUtils.createSpliceSiteCodonChange(variant.getStart(), spliceSiteExon.getExonNumber(), spliceSiteExon.getStart(), spliceSiteExon.getEnd(), strand, offsetIndelAdjustment)
);
}
return gencodeFuncotationBuilder.build();
}