From: Steve S. <se...@us...> - 2007-10-12 13:25:01
|
Update of /cvsroot/gmod/apollo/src/java/apollo/dataadapter/ensj In directory sc8-pr-cvs2.sourceforge.net:/tmp/cvs-serv7413 Modified Files: EnsJAdapter.java Log Message: When fetching by stable id, the location generated was strand specific so no genes on the other strand within the range of the wanted gene were retrieved. Now de-strand the location before fetching. Index: EnsJAdapter.java =================================================================== RCS file: /cvsroot/gmod/apollo/src/java/apollo/dataadapter/ensj/EnsJAdapter.java,v retrieving revision 1.114 retrieving revision 1.115 diff -C2 -d -r1.114 -r1.115 *** EnsJAdapter.java 13 Sep 2007 04:32:29 -0000 1.114 --- EnsJAdapter.java 12 Oct 2007 13:25:00 -0000 1.115 *************** *** 360,364 **** if(gene != null){ ! return gene.getLocation(); } --- 360,364 ---- if(gene != null){ ! return deStrandLocation(gene.getLocation()); } *************** *** 366,370 **** if(transcript != null){ ! return transcript.getLocation(); } --- 366,370 ---- if(transcript != null){ ! return deStrandLocation(transcript.getLocation()); } *************** *** 372,376 **** if(translation != null){ ! return translation.getTranscript().getLocation(); } --- 372,376 ---- if(translation != null){ ! return deStrandLocation(translation.getTranscript().getLocation()); } *************** *** 378,382 **** if(exon != null){ ! return exon.getLocation(); } }catch(AdaptorException exception){ --- 378,382 ---- if(exon != null){ ! return deStrandLocation(exon.getLocation()); } }catch(AdaptorException exception){ *************** *** 390,393 **** --- 390,399 ---- throw new ApolloAdapterException("Cannot find a gene, transcript, translation or exon with input stableID: "+stableID); } + + private Location deStrandLocation(Location strandedLoc) { + Location unstrandedLoc = strandedLoc.copy(); + unstrandedLoc.setStrand(0); + return unstrandedLoc; + } // SMJS Temporary hack |