Skip to content

Commit

Permalink
ah - use new GT encoding (#6822)
Browse files Browse the repository at this point in the history
* change GTs to single character, drop hom ref, add sample metrics to sample metadata tsv
  • Loading branch information
ahaessly authored and mmorgantaylor committed Apr 6, 2021
1 parent 986bf1b commit 1d8e7d1
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 75 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,25 @@ public static List<Integer> getGTAlleleIndexes(final VariantContext variant) {
return allele_indices;
}

public static String getGTString(final VariantContext variant) {
List<Integer> allele_indices = getGTAlleleIndexes(variant);
if (allele_indices.size() != 2){
throw new IllegalArgumentException("GT doesnt have two alleles");
}
String separator = variant.getGenotype(0).isPhased() ? VCFConstants.PHASED : VCFConstants.UNPHASED;
return StringUtils.join(allele_indices, separator);
}

public static List<Integer> getGTAlleleIndexes(final VariantContext variant) {
IndexedAlleleList<Allele> alleleList = new IndexedAlleleList<>(variant.getAlleles());
ArrayList<Integer> allele_indices = new ArrayList<Integer>();

for (Allele allele : variant.getGenotype(0).getAlleles()) {
allele_indices.add(alleleList.indexOfAllele(allele));
}
return allele_indices;
}

public static VCFHeader generateRawArrayVcfHeader(Set<String> sampleNames, final SAMSequenceDictionary sequenceDictionary) {
final Set<VCFHeaderLine> lines = new HashSet<>();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import org.broadinstitute.hellbender.engine.ProgressMeter;
import org.broadinstitute.hellbender.engine.ReferenceDataSource;
import org.broadinstitute.hellbender.tools.variantdb.arrays.BasicArrayData.ArrayGenotype;
import org.broadinstitute.hellbender.tools.variantdb.CommonCode;
import org.broadinstitute.hellbender.tools.variantdb.SchemaUtils;
import org.broadinstitute.hellbender.tools.variantdb.arrays.tables.ProbeInfo;
import org.broadinstitute.hellbender.tools.variantdb.arrays.tables.ProbeQcMetrics;
Expand Down

This file was deleted.

0 comments on commit 1d8e7d1

Please sign in to comment.