From: Josh K. <jos...@us...> - 2003-09-04 21:26:21
|
Update of /cvsroot/gmod/apollo/src/java/apollo/dataadapter/analysis In directory sc8-pr-cvs1:/tmp/cvs-serv7130/apollo/dataadapter/analysis Modified Files: BlatParser.java Log Message: Made changes for reverse strand coordinates on query Index: BlatParser.java =================================================================== RCS file: /cvsroot/gmod/apollo/src/java/apollo/dataadapter/analysis/BlatParser.java,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** BlatParser.java 3 Sep 2003 21:19:53 -0000 1.1 --- BlatParser.java 4 Sep 2003 21:26:15 -0000 1.2 *************** *** 70,73 **** --- 70,74 ---- else reverse_analysis.addFeature (hit, true); + System.out.println ("Hit size is " + hit.size()); //parsedData.errorCheck(); *************** *** 83,86 **** --- 84,88 ---- return (parsed ? getAnalysisType() : null); } + public FeatureSetI createFP () { //generate exon pairs of query and target exons *************** *** 99,145 **** hit.setName(queryName); for (int index = 0; index < blocks; index++) { - // while (index < blocks) { //------------------------------------------------------------// //------------------Set query range---------------------------// ! int qStart = Integer.parseInt( ! (String)splitQueryStarts.elementAt(index) ! ); ! ! //find end point by adding blockSize to qStart ! int qEnd = qStart + Integer.parseInt( ! (String)splitBlockSizes.elementAt(index) ! ); ! ! //add one to qStart to make this base rather than //interbase coordinates ! qStart ++; //make seqFeature SeqFeatureI query = new SeqFeature(); - query.setLow(qStart); - System.out.print("STRAND" + strand + " LOWER" + qStart + "--"); - query.setHigh(qEnd); - System.out.println("HIGHER" + qEnd); - query.setRefSequence(query_seq); query.setStrand(query_strand); query.setName(queryName); //------------------------------------------------------------// //------------------Set target range---------------------------// ! int tStart = Integer.parseInt( ! (String)splitTargetStarts.elementAt(index) ! ); ! int tEnd = tStart + Integer.parseInt( ! (String)splitBlockSizes.elementAt(index) ! ); ! tStart ++; //make seqFeature SeqFeatureI target = new SeqFeature(); - target.setLow(tStart); - System.out.print("TARGET" + strand + " LOWER" + tStart + "--"); - target.setHigh(tEnd); - System.out.println("HIGHER" + tEnd); - target.setRefSequence(target_seq); target.setStrand(1); //------------------------------------------------------------- --- 101,172 ---- hit.setName(queryName); for (int index = 0; index < blocks; index++) { //------------------------------------------------------------// //------------------Set query range---------------------------// ! ! int qLow, qHigh; ! ! //use strand information here ! //because this is blat, the output is similar to the ! //sim4 output. ! //when query is forward, everything is as expected. ! ! if (query_strand == 1) { ! qLow = ! Integer.parseInt((String)splitQueryStarts.elementAt(index)); ! //find end point by adding blockSize to qLow ! qHigh = ! qLow + Integer.parseInt((String)splitBlockSizes.elementAt(index)); ! } ! //when query is reverse, you have to adjust the coordinates ! //essentially, the minus strand blockSizes and qStarts are what ! //you would get if you revcomped the query. But, the qStart and ! //qEnd are non-reveresed ! else { ! qHigh = ! Integer.parseInt(querySize) - ! Integer.parseInt((String)splitQueryStarts.elementAt(index)); ! ! qLow = ! Integer.parseInt(querySize) - ! Integer.parseInt((String)splitQueryStarts.elementAt(index)) - ! Integer.parseInt((String)splitBlockSizes.elementAt(index)); ! } ! ! //add one to qLow to make this base rather than //interbase coordinates ! qLow ++; //make seqFeature SeqFeatureI query = new SeqFeature(); query.setStrand(query_strand); + query.setLow(qLow); + //query.setStart(qLow); + query.setHigh(qHigh); + //query.setEnd(qHigh); + System.out.print("STRAND" + strand + " LOWER" + qLow + "--"); + System.out.println("HIGHER" + qHigh); + System.out.println("SETTING Start as" + qLow + " End" + qHigh + "--"); + query.setRefSequence(query_seq); query.setName(queryName); //------------------------------------------------------------// //------------------Set target range---------------------------// ! int tLow = ! Integer.parseInt((String)splitTargetStarts.elementAt(index)); ! int tHigh = ! tLow + Integer.parseInt((String)splitBlockSizes.elementAt(index)); ! tLow ++; //make seqFeature SeqFeatureI target = new SeqFeature(); target.setStrand(1); + //target.setStart(tLow); + target.setLow(tLow); + //target.setEnd(tHigh); + target.setHigh(tHigh); + System.out.print("TARGET" + strand + " LOWER" + tLow + "--"); + System.out.println("HIGHER" + tHigh); + System.out.println("SETTING Start as" + tLow + " End" + tHigh + "--"); + target.setRefSequence(target_seq); + //------------------------------------------------------------- *************** *** 150,154 **** System.out.println ("Added feature " + fp.getName()); ! System.out.println(tStart + "-" + tEnd + " (" +qStart + "-" + qEnd + ")"); System.out.println("made seqfeature object for each pair"); } --- 177,181 ---- System.out.println ("Added feature " + fp.getName()); ! System.out.println(tLow + "-" + tHigh + " (" +qLow + "-" + qHigh + ")"); System.out.println("made seqfeature object for each pair"); } |