Implemented decodeLoc(..)
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@3713 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
cd2e4b0a1e
commit
f7593435eb
|
|
@ -75,11 +75,17 @@ public class AnnotatorInputTableCodec implements FeatureCodec<AnnotatorInputTabl
|
|||
return null; // TODO: do we want the header to be a concrete type?
|
||||
}
|
||||
|
||||
// todo -- probably worth implementing for performance reasons
|
||||
@Override
|
||||
public Feature decodeLoc(String line) {
|
||||
return decode(line);
|
||||
int tabIndex = line.indexOf(DELIMITER);
|
||||
if(tabIndex <= 0) {
|
||||
throw new CodecLineParsingException("Couldn't parse GenomeLoc out the following line because line.indexOf(DELIMITER) returned " + tabIndex + ".\nLine: " + line);
|
||||
}
|
||||
GenomeLoc loc = GenomeLocParser.parseGenomeLoc(line.substring(0, tabIndex));
|
||||
return new AnnotatorInputTableFeature(loc.getContig(), (int) loc.getStart(), (int) loc.getStop());
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Parses the line into an AnnotatorInputTableFeature object.
|
||||
*
|
||||
|
|
|
|||
|
|
@ -60,6 +60,19 @@ public class AnnotatorInputTableFeature implements Feature {
|
|||
|
||||
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
* @param chr The chromosome name.
|
||||
* @param start
|
||||
* @param end
|
||||
*/
|
||||
public AnnotatorInputTableFeature(String chr, int start, int end) {
|
||||
this.chr = chr;
|
||||
this.start = start;
|
||||
this.end = end;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
* @param columnNames The column names as parsed out of the file header.
|
||||
|
|
|
|||
Loading…
Reference in New Issue