Bug in setContig() fixed: sequence dictionary's .getSequences().contains() and .getSequences().indexOf() do NOT work when applied to contig names (Strings), since getSequences() returns a list of SAMSequenceRecord's; changed to querying the dictionary directly for specified contig name
git-svn-id: file:///humgen/gsa-scr1/gsa-engineering/svn_contents/trunk@1147 348d0f76-0448-11de-a6fe-93d51630548a
This commit is contained in:
parent
76fd4b3848
commit
7462f3f344
|
|
@ -487,10 +487,12 @@ public class GenomeLocParser {
|
|||
*/
|
||||
public static GenomeLoc setContig(GenomeLoc loc, String contig) {
|
||||
checkSetup();
|
||||
if (!GenomeLocParser.contigInfo.getSequences().contains(contig)) {
|
||||
|
||||
int index = -1;
|
||||
if ( ( index = contigInfo.getSequenceIndex(contig) ) < 0 ) {
|
||||
throw new StingException("Contig name ( " + contig + " ) not in the set sequence dictionary.");
|
||||
}
|
||||
return verifyGenomeLoc(new GenomeLoc(contig, GenomeLocParser.contigInfo.getSequences().indexOf(contig), loc.start, loc.getStop()));
|
||||
return verifyGenomeLoc(new GenomeLoc(contig, index, loc.start, loc.getStop()));
|
||||
}
|
||||
|
||||
/** Sets contig index. UNSAFE since it 1) does NOT update contig name; 2) does not validate the index
|
||||
|
|
|
|||
Loading…
Reference in New Issue