本文整理汇总了Java中htsjdk.variant.variantcontext.Genotype.getType方法的典型用法代码示例。如果您正苦于以下问题:Java Genotype.getType方法的具体用法?Java Genotype.getType怎么用?Java Genotype.getType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类htsjdk.variant.variantcontext.Genotype
的用法示例。
在下文中一共展示了Genotype.getType方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: determineOrganismType
import htsjdk.variant.variantcontext.Genotype; //导入方法依赖的package包/类
private void determineOrganismType(VariantGA4GH ghEntity, GenotypeData genotypeData,
int altIndex, List<Allele> alleleList, Genotype genotype) {
final OrganismType organismType;
int[] genotypeArray = null;
switch (genotype.getType()) {
case HOM_VAR:
organismType = OrganismType.HOMOZYGOUS;
genotypeArray = new int[]{altIndex, altIndex};
break;
case MIXED:
case HET:
genotypeArray = new int[2];
organismType = determineHeterozygousGenotypeGA4GH(ghEntity, alleleList, genotypeArray);
break;
case UNAVAILABLE:
case NO_CALL:
organismType = OrganismType.NOT_SPECIFIED;
break;
case HOM_REF:
organismType = OrganismType.NO_VARIATION;
genotypeArray = new int[]{0, 0};
break;
default:
organismType = OrganismType.NOT_SPECIFIED;
}
genotypeData.setOrganismType(organismType);
genotypeData.setGenotype(genotypeArray);
}
示例2: getGenotypeData
import htsjdk.variant.variantcontext.Genotype; //导入方法依赖的package包/类
@NotNull private GenotypeData getGenotypeData(VariantContext context, Genotype genotype) {
GenotypeData genotypeData;
if (genotype == null) {
genotypeData = new GenotypeData();
genotypeData.setOrganismType(OrganismType.NOT_SPECIFIED);
} else {
int[] genotypeArray = null;
OrganismType organismType;
switch (genotype.getType()) {
case HOM_VAR:
organismType = OrganismType.HOMOZYGOUS;
int altIndex = context.getAlternateAlleles().indexOf(genotype.getAllele(0)) + 1;
genotypeArray = new int[]{altIndex, altIndex};
break;
case MIXED:
case HET:
genotypeArray = new int[2];
organismType = determineHeterozygousGenotype(context, genotype, genotypeArray);
break;
case UNAVAILABLE:
case NO_CALL:
organismType = OrganismType.NOT_SPECIFIED;
break;
case HOM_REF:
organismType = OrganismType.NO_VARIATION;
genotypeArray = new int[]{0, 0};
break;
default:
organismType = OrganismType.NOT_SPECIFIED;
}
genotypeData = new GenotypeData(organismType, genotypeArray, genotype.getGenotypeString());
}
return genotypeData;
}
示例3: initGenotypeTypeField
import htsjdk.variant.variantcontext.Genotype; //导入方法依赖的package包/类
private void initGenotypeTypeField(VariantContext variant) {
String mutationString = null;
GenotypeType gtt = GenotypeType.NO_CALL;
String prefSampleName = VariantReviewPlugin.getPreferentialSampleName();
//If there is only one sample, or we find the preferential sample,
//use that data.
for (String sampleName : variant.getSampleNamesOrderedByName()) {
boolean isPref = sampleName.equalsIgnoreCase(prefSampleName);
if (isPref || mutationString == null) {
if(!variantContext.isBiallelic())
sampleVC = variantContext.subContextFromSamples(Collections.singleton(sampleName), true);
else
sampleVC = variantContext;
mutationString = ParsingUtils.join(",", ParsingUtils.sortList(sampleVC.getAlleles()));
Genotype genotype = sampleVC.getGenotype(sampleName);
gtt = genotype.getType();
if (isPref) break;
} else {
//If we have several samples with different mutations, don't know which
//to pick. Make that obvious to the user
if (gtt != sampleVC.getGenotype(sampleName).getType()) {
mutationString = "./.";
gtt = GenotypeType.UNAVAILABLE;
}
}
}
genotypeTypeField.setSelectedItem(gtt);
mutField.setText(mutationString);
mutField.setToolTipText(mutationString);
}