Skip to content

Commit 792c67f

Browse files
committed
update FilterPIPseq to accomodate multi nt filter
The existing GUI allows a multi-nucleotide sequence filter in the text box (default="T") which implies an ability to filter by different lengthed nucleotides. This commit updates the script to handle filter sequence strings that are more than one nucleotide long.
1 parent 0103ed2 commit 792c67f

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/scripts/BAM_Manipulation/FilterforPIPseq.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,12 @@ public void run() throws IOException, InterruptedException {
7171
if (!sr.getReadNegativeStrandFlag()) {
7272
if (sr.getUnclippedStart() - 1 > 0) {
7373
filter = new String(QUERY.getSubsequenceAt(seq.getSequenceName(),
74-
sr.getUnclippedStart() - 1, sr.getUnclippedStart() - 1).getBases());
74+
sr.getUnclippedStart() - SEQ.length(), sr.getUnclippedStart() - 1).getBases());
7575
}
7676
} else {
7777
if (sr.getUnclippedEnd() + 1 <= seq.getSequenceLength()) {
7878
filter = new String(QUERY.getSubsequenceAt(seq.getSequenceName(),
79-
sr.getUnclippedEnd() + 1, sr.getUnclippedEnd() + 1).getBases());
79+
sr.getUnclippedEnd() + 1, sr.getUnclippedEnd() + SEQ.length()).getBases());
8080
filter = FASTAUtilities.RevComplement(filter);
8181
}
8282
}
@@ -91,11 +91,11 @@ public void run() throws IOException, InterruptedException {
9191
String filter = "";
9292
// if on the positive strand
9393
if (!sr.getReadNegativeStrandFlag()) {
94-
filter = new String(QUERY.getSubsequenceAt(seq.getSequenceName(), sr.getUnclippedStart() - 1,
95-
sr.getUnclippedStart() - 1).getBases());
94+
filter = new String(QUERY.getSubsequenceAt(seq.getSequenceName(),
95+
sr.getUnclippedStart() - SEQ.length(), sr.getUnclippedStart() - 1).getBases());
9696
} else {
9797
filter = new String(QUERY.getSubsequenceAt(seq.getSequenceName(), sr.getUnclippedEnd() + 1,
98-
sr.getUnclippedEnd() + 1).getBases());
98+
sr.getUnclippedEnd() + SEQ.length()).getBases());
9999
filter = FASTAUtilities.RevComplement(filter);
100100
}
101101
// System.out.println(sr.getReadString() + "\t" + seq.getSequenceName() + "\t" +

0 commit comments

Comments
 (0)