Skip to content

Commit

Permalink
Fixes/remove phased check (#13)
Browse files Browse the repository at this point in the history
* Remove phased check since its decided on user specification.

* remove unused phasing autodetect method
  • Loading branch information
seppinho authored Dec 18, 2024
1 parent d3403f9 commit ace1b08
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -194,11 +194,6 @@ private boolean checkVcfFiles() throws Exception {

phased = phased && vcfFile.isPhased();

if (vcfFile.isPhasedAutodetect() && !vcfFile.isPhased()) {
output.error("File should be phased, but also includes unphased and/or missing genotypes! Please double-check!");
return false;
}

if (noSamples < minSamples && minSamples != 0) {
output.error("At least " + minSamples + " samples must be uploaded.");
return false;
Expand Down
10 changes: 0 additions & 10 deletions src/main/java/genepi/imputationserver/steps/vcf/VcfFile.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ public class VcfFile {

private boolean chrX = false;

private boolean phasedAutodetect = true;

private int chunkSize;

private boolean chrPrefix;
Expand Down Expand Up @@ -135,14 +133,6 @@ public String getType() {
}
}

public boolean isPhasedAutodetect() {
return phasedAutodetect;
}

public void setPhasedAutodetect(boolean phasedAutodetect) {
this.phasedAutodetect = phasedAutodetect;
}

public void setChunkSize(int chunkSize) {
this.chunkSize = chunkSize;
}
Expand Down
16 changes: 0 additions & 16 deletions src/main/java/genepi/imputationserver/steps/vcf/VcfFileUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ public static VcfFile load(String vcfFilename, int chunksize, boolean createInde
LineReader lineReader = new LineReader(vcfFilename);

boolean phased = true;
boolean phasedAutodetect = true;
boolean firstLine = true;
while (lineReader.next()) {

Expand Down Expand Up @@ -64,20 +63,6 @@ public static VcfFile load(String vcfFilename, int chunksize, boolean createInde

}

if (firstLine) {
boolean containsSymbol = tiles[9].contains("/") || tiles[9].contains(".");

if (!containsSymbol) {
phasedAutodetect = true;
} else {
phasedAutodetect = false;
}
firstLine = false;

}

// TODO: check that all are phased
// context.getGenotypes().get(0).isPhased();
chromosomes.add(chromosome);
if (chromosomes.size() > 1) {
throw new IOException(
Expand Down Expand Up @@ -154,7 +139,6 @@ public static VcfFile load(String vcfFilename, int chunksize, boolean createInde
pair.setRawChromosomes(rawChromosomes);
pair.setChrPrefix(hasChrPrefix);
pair.setPhased(phased);
pair.setPhasedAutodetect(phasedAutodetect);
pair.setChunkSize(chunksize);
return pair;

Expand Down

0 comments on commit ace1b08

Please sign in to comment.