Skip to content

Commit e92a4b6

Browse files
committed
v3.3.3
1 parent ec8b03d commit e92a4b6

File tree

20 files changed

+287
-290
lines changed

20 files changed

+287
-290
lines changed

doc/Release.html

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,25 @@
66
<a id=top>
77
<!--#include virtual="./ssi/start1.html" -->
88

9+
<h4>v3.3.3 25-Sept-2021</h4>
10+
11+
<ttp>viewSingleTCW</ttp> - tiny fixes
12+
<ul>
13+
<li>Exports now write the correct filename of output to the terminal.
14+
<li>Sequence Detail - Frame: The Y-axis coordinate has been changed so that it can
15+
be added to the X-axis coordinate to get the last base of the respective codon.
16+
<li>Sequence Detail - Align:
17+
<ul>
18+
<li>The highlight UTR would incorrectly extend over a hit overhang.
19+
<li>The highlight HIT included one extra AA.
20+
<li>Trim showed an extra AA on the 3' end.
21+
<li>When the "Hit" was highlighted for a negative frame, the coordinates were often
22+
off by 1.
23+
</ul>
24+
<li>Main Table "Export GOs from Table" did not work if there were no GOseq values.
25+
<li>Basic GO: The "Show" was recently broken, and has been fixed.
26+
</ul>
27+
928
<h4>v3.3.2 15-Sept-2021</h4>
1029
Fixes for bugs recently introduced bugs and one display improvement.
1130

doc/stcw/DiffExp.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -495,7 +495,7 @@ <h2>5. Remove</h2>
495495
In both cases, either all columns can be removed or a selected column.
496496

497497
<!-- ============= R-scripts ============== -->
498-
<a id="rscripts"></a>
498+
<a id="DEscripts"></a>
499499
<table style="width: 100%"><tr><td style="text-align: left">
500500
<h2>6. R-scripts</h2>
501501
<td style="text-align: right"><a href="#top">Go to top</a></td></tr></table>
-1.21 MB
Loading

doc/tour/viewSingle/seqDetails.html

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ <h3>Frame</h3>
5858
hit is shown in italics, where it forms a perfect ORF in this example.
5959
The sequence can be shown in alternative frames using the
6060
<ttc>Frame</ttc> pull-down.
61-
<p>The TCW selected best frame is the top one listed.
62-
The TCW algorithm uses hit information, 5th-order Markov score,
63-
and start/stop codons to compute the best frame.
64-
<td><a href="img/seqFrame.png"><img src="img/seqFrame.png" alt="" style="border: 1px solid black; width: 550px"></a>
61+
<p>By default, the <ttl>Assigned ORF</ttl> will be shown, but can be changed with the <ttc>Frame</ttc> pull-down.
62+
63+
<p>The TCW algorithm uses hit information, 5th-order Markov score, and start/stop codons to compute the best frame.
64+
<td><a href="img/seqFrame.png"><img src="img/seqFrame.png" alt="" style="border: 1px solid black; width: 600px"></a>
6565
</tr>
6666
</table>
6767

@@ -70,7 +70,6 @@ <h3>Frame</h3>
7070
<h3>Align Hits...</h3>
7171
<td style="text-align: right"><a href="#top">Go to top</a></td></tr></table>
7272

73-
7473
<table>
7574
<tr><td class="top">
7675
<p>There are options to show:

java/src/html/viewSingleTCW/DetailFramePanel.html

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,29 @@ <h1>Sequence Frame</h1>
1212
It uses a combination of protein hit, 5th-order Markov Chain
1313
and length (for more detail, see www.agcol.arizona.edu/software/tcw/doc/stcw/ORF.html).
1414

15+
<h3>Display</h3>
16+
The first line provides the RF of the Best ORF along with its length;
17+
the Best ORF is displayed by default. The following lines best ORF in each of the 6 frames. The selected
18+
ORF will have a ">" in front of it.
19+
<p>To calculate the <i>nucleotide</i> coordinate of a particular base:
20+
<ul>
21+
<li><u>Forward</u>:
22+
<br>&emsp;&emsp;&emsp;&emsp;Y-axis# + X-axis# = last base of the codon.
23+
<br>&emsp;&emsp;&emsp;&emsp;Y-axis# + X-axis# - 2 = first base of the codon.
24+
<li><u>Reverse</u>:
25+
<br>&emsp;&emsp;&emsp;&emsp;Y-axis# - X-axis# = last base of the codon.
26+
<br>&emsp;&emsp;&emsp;&emsp;Y-axis# - X-axis# + 2 = first base of the codon.
27+
<li><u>Hit coordinates</u>:
28+
<ul>
29+
<li>Forward: (Y-axis# + X-axis# - 2) to (Y-axis# + X-axis#)
30+
<li>Reverse: (Y-axis# - X-axis# + 2) to (Y-axis# - X-axis#)
31+
</ul>
32+
</ul>
33+
<p>To calculate the coordinate of a particular amino acid:
34+
<ul>
35+
<li><u>Forward</u>: Y-axis# + X-axis#
36+
<li><u>Reverse</u> :Y-axis# - X-axis#
37+
</ul>
1538
<h3>Frame Options - second row of buttons</h3>
1639

1740
<b>Frame</b> toggle: By default, the TCW selected frame is shown. This button allows

java/src/sng/database/MetaData.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@ public static TreeMap <String, Integer> getGoRelTypes(DBConn mDB) {// CAS319 add
425425
public int getNumSeqSets() { return seqLibNames.length; }
426426
public String [] getSeqNames() { return seqLibNames; }
427427
public String [] getSeqTitles() { return seqLibTitles; }
428-
public String [] getDENames() { return deNames; }
428+
public String [] getDENames() { return deNames; } // is null if no deNames
429429
public String [] getDETitles() { return deTitles; }
430430
public String [] getLibNames() { return expLibNames; }
431431
public String [] getLibTitles() { return expLibTitles; }
Lines changed: 5 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,24 @@
11
package sng.dataholders;
22

3-
import java.io.Serializable;
4-
import java.lang.Comparable;
5-
63
/**
4+
* CAS333 cleaned out stuff including comparable
75
* Holds all of the data corresponding to a coding region. The begin and
86
* end are always relative to the sequence that the coding region
97
* corresponds to.
108
*/
11-
public class CodingRegion implements Comparable<CodingRegion>, Serializable
9+
public class CodingRegion
1210
{
1311
public static final int TYPE_UNKWOWN = 0;
1412
public static final int TYPE_ORF = 1;
1513
public static final int TYPE_LARGEST_ORF = 2;
1614
public static final int TYPE_UNIPROT = 3;
1715

18-
private boolean debug = false;
1916
/**
2017
* Creates a new CodingRegion object with one of the following types:
21-
* (TYPE_UNKWOWN | TYPE_ORF | TYPE_LARGEST_ORF | TYPE_UNIPROT)
18+
* (TYPE_UNKNOWN | TYPE_ORF | TYPE_LARGEST_ORF | TYPE_UNIPROT)
2219
* @param nInType The type of the coding region
2320
*/
24-
public CodingRegion ( int nInType ) { nType = nInType;
25-
if (debug) System.err.println("Create Coding region " + nType);}
26-
27-
public void setType ( int nInType ) { nType = nInType; }
28-
29-
public String getDescription ( )
30-
{
31-
int len = (nEnd-nBegin)+1;
32-
String s = "Frame " + nFrame + " Start " + nBegin + " End " + nEnd + " Len " + len ;
33-
switch ( nType )
34-
{
35-
case TYPE_ORF: return "ORF " + s;
36-
case TYPE_LARGEST_ORF: return "Largest ORF " + s;
37-
case TYPE_UNIPROT: return "Protein ORF " + s;
38-
default: return "?";
39-
}
40-
}
21+
public CodingRegion ( int nInType ) { nType = nInType; }
4122

4223
public int getBegin () { return nBegin; };
4324
public void setBegin ( int n ) { nBegin = n; };
@@ -51,62 +32,9 @@ public String getDescription ( )
5132
public boolean getHasEnd () { return bHasEnd; };
5233
public void setHasEnd ( boolean b ) { bHasEnd = b; };
5334

54-
public int getLength () { return nEnd - nBegin + 1; }
55-
5635
public int getFrame () { return nFrame; };
5736
public void setFrame ( int n ) { nFrame = n; }
5837

59-
public boolean getIsComplement ( ) { return nFrame < 0; }
60-
61-
public boolean getHasStartCodon ()
62-
{
63-
return ( getHasBegin () && !getIsComplement ( ) ) ||
64-
( getHasEnd () && getIsComplement ( ) );
65-
}
66-
67-
public int getStartCodonIndex ( )
68-
{
69-
if ( !getIsComplement ( ) )
70-
{
71-
if ( getHasBegin () )
72-
return nBegin;
73-
else
74-
return nBegin + Math.abs( nFrame ) - 1;
75-
}
76-
else
77-
{
78-
if ( getHasEnd () )
79-
return nEnd;
80-
else
81-
return nEnd + Math.abs( nFrame ) - 1;
82-
}
83-
}
84-
85-
public int getStopIndex ( )
86-
{
87-
if ( !getIsComplement ( ) )
88-
return nEnd;
89-
else
90-
return nBegin;
91-
}
92-
93-
public int compareTo(CodingRegion rORF)
94-
{
95-
// First compare the width. The wider the better.
96-
if ( getLength () != rORF.getLength() )
97-
return rORF.getLength() - getLength ();
98-
99-
// Otherwise if only one has both start and stop consider it better
100-
if ( getHasBegin () && getHasEnd () && (!rORF.getHasBegin() || !rORF.getHasEnd() ) )
101-
return -1;
102-
if ( rORF.getHasBegin () && rORF.getHasEnd () && (!getHasBegin() || !getHasEnd() ) )
103-
return 1;
104-
105-
return 0;
106-
}
107-
108-
public Object clone () { return cloneRegion (); }
109-
11038
/**
11139
* @return copy of the coding region
11240
*/
@@ -121,41 +49,7 @@ public CodingRegion cloneRegion ( )
12149

12250
return copy;
12351
}
124-
125-
public void sanityCheck ()
126-
{
127-
if ( nFrame < -3 || nFrame == 0 || nFrame > 3 )
128-
throw new RuntimeException ( "Invalid frame of " + nFrame );
129-
if ( nBegin > nEnd )
130-
throw new RuntimeException ( "Coding Begin > End" );
131-
if ( nEnd - nBegin < 6 )
132-
throw new RuntimeException ( "Coding region less than two codons: " + nEnd + " " + nBegin );
133-
}
134-
135-
136-
public CodingRegion getComplement ( int nSeqMinIndex, int nSeqMaxIndex )
137-
{
138-
// Sanity
139-
String s = "MinIndex " + nSeqMinIndex + " MaxIndex " + nSeqMaxIndex + " begin " + nBegin + " end " + nEnd;
140-
if ( nSeqMinIndex > nSeqMaxIndex )
141-
throw new RuntimeException ( "Min index > Max index. " + s);
142-
if ( nBegin < nSeqMinIndex )
143-
throw new RuntimeException ( "Begin < than min index. " + s);
144-
if ( nEnd > nSeqMaxIndex )
145-
throw new RuntimeException ( "End > than max index. " + s);
146-
147-
CodingRegion comp = cloneRegion ();
148-
comp.bHasBegin = bHasEnd;
149-
comp.bHasEnd = bHasBegin;
150-
comp.nFrame = -nFrame;
151-
comp.nEnd = nSeqMaxIndex - (nBegin - nSeqMinIndex);
152-
comp.nBegin = nSeqMaxIndex - (nEnd - nSeqMinIndex);
153-
comp.sanityCheck();
154-
return comp;
155-
}
156-
157-
public void clear()
158-
{
52+
public void clear(){
15953
// nothing to clear
16054
}
16155

@@ -167,6 +61,4 @@ public void clear()
16761
private int nBegin = 0;
16862
private int nEnd = -1;
16963
private int nLen = 0;
170-
171-
private static final long serialVersionUID = 1;
17264
}

java/src/sng/dataholders/SequenceData.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,8 @@ public SequenceData newSeqDataNTtoAA(int nFrame) {
334334
String transSeq = aaSeqData.ntSeqData.strSequence;
335335

336336
// Translation
337-
for (int i = nFrame-1; i < transSeq.length() - 3; i+=3) {
337+
int end = transSeq.length() - 2; //CAS333 was -3, which was not getting last codon for F1&F3
338+
for (int i = nFrame-1; i < end; i+=3) {
338339
char c = AAStatistics.getAminoAcidFor(
339340
transSeq.charAt(i), transSeq.charAt(i+1),transSeq.charAt(i+2));
340341
newSequence += c;

java/src/sng/util/MainTable.java

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ public boolean saveToFileTabDelim(Component btnC, String fileName, STCWFrame fra
220220
}
221221
pw.println();
222222
}
223-
Out.prt("Complete writing " + nRow + " records to " + fileName);
223+
Out.prt("Complete writing " + nRow + " records to " + fwObj.getFileName()); // CAS333 was fileName
224224
pw.close();
225225
return true;
226226
}
@@ -265,7 +265,7 @@ public boolean saveToFasta(Component btnC, String fileName, STCWFrame frame) {
265265
}
266266
if (rs!=null) rs.close();
267267
pw.close(); mdb.close();
268-
Out.prt("Complete writing " + rowCnt + " sequences to " + fileName);
268+
Out.prt("Complete writing " + rowCnt + " sequences to " + fwObj.getFileName());
269269
return true;
270270
}
271271
catch (Exception err) {ErrorReport.reportError(err, "Internal error: exporting table to " + fileName);}
@@ -341,7 +341,7 @@ public boolean saveHitsToFasta(Component btnC, String fileName, STCWFrame frame,
341341
if (rs!=null) rs.close();
342342
pw.close(); mdb.close();
343343
Out.PrtSpMsgCntZero(1, "Non UniProt hits", nonUP);
344-
Out.prt("Complete writing hit sequences to " + fileName);
344+
Out.prt("Complete writing hit sequences to " + fwObj.getFileName());
345345
return true;
346346
}
347347
catch (Exception err) {ErrorReport.reportError(err, "Internal error: exporting table to " + fileName);}
@@ -398,7 +398,7 @@ public boolean saveORFToFasta(Component btnC, String fileName, STCWFrame frame)
398398
}
399399
pw.close(); mdb.close();
400400
Out.PrtSpCntMsgZero(1, ignore, "Ignore records with frame=0");
401-
Out.prt("Complete writing " + prt + " records to " + fileName);
401+
Out.prt("Complete writing " + prt + " records to " + fwObj.getFileName());
402402
return true;
403403
}
404404
catch (Exception err) {ErrorReport.reportError(err, "Internal error: exporting table\nQuery: " + query);}
@@ -489,7 +489,7 @@ public boolean saveToFileCounts(Component btnC, String fileName, STCWFrame frame
489489
}
490490
expPW.close();
491491
rs.close(); mdb.close();
492-
Out.prtSp(0, "Complete writing " + cnt + " line to " + fileName);
492+
Out.prtSp(0, "Complete writing " + cnt + " line to " + fwObj.getFileName());
493493
return true;
494494
}
495495
catch (Exception err) {ErrorReport.reportError(err,"TCW error: exporting count table" );}
@@ -565,7 +565,7 @@ public boolean saveGOFromBest(Component btnC, String fileName, STCWFrame frame)
565565
}
566566
pw.close(); mdb.close();
567567
Out.PrtSpCntMsg(1, cntNoGO, "Sequences with no GOs");
568-
Out.prt("Complete writing " + cnt + " sequences and " + cntGO + " GOs to " + fileName);
568+
Out.prt("Complete writing " + cnt + " sequences and " + cntGO + " GOs to " + fwObj.getFileName());
569569
return true;
570570
}
571571
catch (Exception err) {ErrorReport.reportError(err, "Internal error: exporting GO for table\nQuery: " + query);}
@@ -656,7 +656,7 @@ public boolean saveGOtoFile(Component btnC, String fileName, STCWFrame frame, St
656656
String [] de = frame.getMetaData().getDENames(); // CAS322 was reading database
657657
Vector<String> pcols = new Vector<String>();
658658
String deCols="";
659-
if (de.length>0) {
659+
if (de!=null && de.length>0) { // CAS333 was not checking for null
660660
for (String d : de) {
661661
pcols.add(d);
662662
deCols += "," + Globalx.PVALUE + d;
@@ -698,7 +698,7 @@ public boolean saveGOtoFile(Component btnC, String fileName, STCWFrame frame, St
698698
}
699699
pw.close();
700700
rs.close(); mdb.close();
701-
Out.PrtSpMsg(0, "Complete writing " + nrows + " rows to " + fileName);
701+
Out.PrtSpMsg(0, "Complete writing " + nrows + " rows to " + fwObj.getFileName());
702702
return true;
703703
}
704704
catch(Exception e){ ErrorReport.prtReport(e, "Writing GO file");}

java/src/sng/viewer/STCWMain.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,8 +62,8 @@ public static void main(String[] args)
6262
System.err.println("Time query executions turned on.");
6363
doTIME = true;
6464
}
65-
if (hasOption(args, "-test")) { // CAS313
66-
System.err.println("Test turned on.");
65+
if (hasOption(args, "-d")) { // CAS313
66+
System.err.println("Debug turned on.");
6767
Globalx.debug = true;
6868
}
6969
String dbstr = (args.length>0) ? args[0] : "";

0 commit comments

Comments
 (0)