-Support for 1KG SNP calls in RODs
-Minor bug fix git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@987 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
5440dd13df
commit
ffffe3b2f6
|
|
@ -66,6 +66,7 @@ public class ReferenceOrderedData<ROD extends ReferenceOrderedDatum> implements
|
||||||
addModule("RefSeq", rodRefSeq.class);
|
addModule("RefSeq", rodRefSeq.class);
|
||||||
addModule("Table", TabularROD.class);
|
addModule("Table", TabularROD.class);
|
||||||
addModule("PooledEM", PooledEMSNPROD.class);
|
addModule("PooledEM", PooledEMSNPROD.class);
|
||||||
|
addModule("1KGSNPs", KGenomesSNPROD.class);
|
||||||
addModule("Intervals", IntervalRod.class);
|
addModule("Intervals", IntervalRod.class);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ import org.apache.log4j.Logger;
|
||||||
public class TabularROD extends BasicReferenceOrderedDatum implements Map<String, String> {
|
public class TabularROD extends BasicReferenceOrderedDatum implements Map<String, String> {
|
||||||
private static Logger logger = Logger.getLogger(TabularROD.class);
|
private static Logger logger = Logger.getLogger(TabularROD.class);
|
||||||
|
|
||||||
private GenomeLoc loc;
|
protected GenomeLoc loc;
|
||||||
private HashMap<String, String> attributes;
|
private HashMap<String, String> attributes;
|
||||||
private ArrayList<String> header;
|
private ArrayList<String> header;
|
||||||
|
|
||||||
|
|
@ -176,7 +176,15 @@ public class TabularROD extends BasicReferenceOrderedDatum implements Map<String
|
||||||
if ( header != null ) {
|
if ( header != null ) {
|
||||||
logger.debug(String.format("HEADER IS %s%n", Utils.join(":", header)));
|
logger.debug(String.format("HEADER IS %s%n", Utils.join(":", header)));
|
||||||
} else {
|
} else {
|
||||||
throw new RuntimeException("Couldn't find header line in TabularROD!");
|
// use the indexes as the header fields
|
||||||
|
logger.debug("USING INDEXES FOR ROD HEADER");
|
||||||
|
// reset if necessary
|
||||||
|
if ( !reader.hasNext() )
|
||||||
|
reader = new xReadLines(source);
|
||||||
|
header = new ArrayList<String>();
|
||||||
|
int tokens = reader.next().split(DELIMITER_REGEX).length;
|
||||||
|
for ( int i = 0; i < tokens; i++)
|
||||||
|
header.add(Integer.toString(i));
|
||||||
}
|
}
|
||||||
|
|
||||||
return header;
|
return header;
|
||||||
|
|
@ -188,6 +196,7 @@ public class TabularROD extends BasicReferenceOrderedDatum implements Map<String
|
||||||
//
|
//
|
||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
public GenomeLoc getLocation() {
|
public GenomeLoc getLocation() {
|
||||||
|
loc = GenomeLoc.parseGenomeLoc(get(header.get(0)));
|
||||||
return loc;
|
return loc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -282,8 +291,7 @@ public class TabularROD extends BasicReferenceOrderedDatum implements Map<String
|
||||||
throw new IOException(String.format("Header length %d not equal to Tabular parts length %d", header.size(), parts.length));
|
throw new IOException(String.format("Header length %d not equal to Tabular parts length %d", header.size(), parts.length));
|
||||||
}
|
}
|
||||||
|
|
||||||
loc = GenomeLoc.parseGenomeLoc(parts[0]);
|
for ( int i = 0; i < parts.length; i++ ) {
|
||||||
for ( int i = 1; i < parts.length; i++ ) {
|
|
||||||
put(header.get(i), parts[i]);
|
put(header.get(i), parts[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -111,7 +111,7 @@ public class VariantEvalWalker extends RefWalker<Integer, Integer> {
|
||||||
updateAnalysisSet(ALL_SNPS, eval, tracker, ref, context);
|
updateAnalysisSet(ALL_SNPS, eval, tracker, ref, context);
|
||||||
|
|
||||||
if ( eval instanceof SNPCallFromGenotypes ) {
|
if ( eval instanceof SNPCallFromGenotypes ) {
|
||||||
SNPCallFromGenotypes call = (PooledEMSNPROD)eval;
|
SNPCallFromGenotypes call = (SNPCallFromGenotypes)eval;
|
||||||
int nVarGenotypes = call.nHetGenotypes() + call.nHomVarGenotypes();
|
int nVarGenotypes = call.nHetGenotypes() + call.nHomVarGenotypes();
|
||||||
//System.out.printf("%d variant genotypes at %s%n", nVarGenotypes, calls);
|
//System.out.printf("%d variant genotypes at %s%n", nVarGenotypes, calls);
|
||||||
final String s = nVarGenotypes == 1 ? SINGLETON_SNPS : TWOHIT_SNPS;
|
final String s = nVarGenotypes == 1 ? SINGLETON_SNPS : TWOHIT_SNPS;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue