Skip to content

Commit 816e8ab

Browse files
committed
automatically set reverse-complement
1 parent 45cfa53 commit 816e8ab

File tree

3 files changed

+25
-4
lines changed

3 files changed

+25
-4
lines changed
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
var COMPLEMENT_BASES = {'A': 'T', 'T': 'A', 'G': 'C', 'C': 'G'};
2+
3+
function beforeUpsert(row, errors) {
4+
if (row.sequence){
5+
row.sequence = row.sequence.toUpperCase();
6+
7+
var reverseSeq = row.sequence.split('').reverse().join('');
8+
row.reverse_complement = reverseSeq.replace(/[ATCG]/g, function($0){
9+
return COMPLEMENT_BASES[$0]
10+
});
11+
}
12+
}
13+
14+
function beforeInsert(row, errors) {
15+
beforeUpsert(row, errors);
16+
}
17+
18+
function beforeUpdate(row, oldRow, errors) {
19+
beforeUpsert(row, errors);
20+
}

SequenceAnalysis/resources/schemas/sequenceanalysis.xml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<tables xmlns="http://labkey.org/data/xml">
1+
<tables xsi:schemaLocation="http://labkey.org/data/xml ..\..\..\..\schemas\tableInfo.xsd" xmlns="http://labkey.org/data/xml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
22
<table tableName="barcodes" tableDbType="TABLE" useColumnOrder="true">
33
<auditLogging>DETAILED</auditLogging>
44
<tableTitle>DNA Barcodes</tableTitle>
@@ -15,8 +15,9 @@
1515
<description>This should be the forward orientation of the sequence, as it appears in the adapter sequence</description>
1616
</column>
1717
<column columnName="reverse_complement">
18-
<nullable>false</nullable>
18+
<nullable>true</nullable>
1919
<inputType>textarea</inputType>
20+
<isUserEditable>false</isUserEditable>
2021
<description>The reverse complement of the sequence</description>
2122
</column>
2223
<column columnName="group_name">

SequenceAnalysis/src/org/labkey/sequenceanalysis/analysis/CellHashingHandler.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,8 +114,8 @@ public static List<ToolParameterDescriptor> getDefaultParams(boolean allowScanni
114114
put("allowBlank", false);
115115
}}, defaultTagGroup),
116116
ToolParameterDescriptor.create("useOutputFileContainer", "Submit to Source File Workbook", "If checked, each job will be submitted to the same workbook as the input file, as opposed to submitting all jobs to the same workbook. This is primarily useful if submitting a large batch of files to process separately. This only applies if 'Run Separately' is selected.", "checkbox", new JSONObject(){{
117-
put("checked", false);
118-
}}, false)
117+
put("checked", true);
118+
}}, true)
119119
));
120120

121121
return ret;

0 commit comments

Comments
 (0)