Skip to content

Commit

Permalink
add the plot_align script
Browse files Browse the repository at this point in the history
  • Loading branch information
hasindu2008 committed Sep 15, 2022
1 parent 83c949b commit 1cb111f
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions scripts/plot_align.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
#!/bin/bash

#This is a dirty script to plot the alignment of a signal to a reference using matlab
#mainly for my own use

#scripts/plot_align.sh test/batch0.blow5 1d72c1af-0e12-4326-9310-407a15fa7b2b test/batch0.fastq

set -e
Expand All @@ -26,7 +29,6 @@ ${SLOW5TOOLS} --version &> /dev/null || { echo -e $RED"slow5tools not found! Eit
${F5C} --version &> /dev/null || { echo -e $RED"f5c not found! Either put f5c under path or set F5C variable, e.g.,export F5C=/path/to/f5c"$NORMAL; exit 1;}
samtools --version &> /dev/null || { echo -e $RED"samtools not found in path!"$NORMAL; exit 1;}


rm -f sigtk_${read_id}.tmp sigtk_${read_id}.events.tmp sigtk_${read_id}.fasta sigtk_${read_id}.blow5 sigtk_${read_id}.resquigged.tmp sigtk_${read_id}_bases.tmp

KMER_SIZE=6
Expand Down Expand Up @@ -87,8 +89,17 @@ if [[ "${SIGTK_PLOT_MTD}" == "matlab" ]]; then
%kmers
base=convertStringsToChars(base)';
for j=1:length(base)-${KMER_SIZE}+1
kmers{j}=strcat(char(base(j)),char(base(j+1)),char(base(j+2)),char(base(j+3)),char(base(j+4)),char(base(j+5)));
if(${KMER_SIZE}==6)
kmers{j}=strcat(char(base(j)),char(base(j+1)),char(base(j+2)),char(base(j+3)),char(base(j+4)),char(base(j+5)));
else
kmers{j}=strcat(char(base(j)),char(base(j+1)),char(base(j+2)),char(base(j+3)),char(base(j+4)));
end
end
if(${KMER_SIZE}==5)
kmers=flip(kmers);
end
h=text(x,y,cellstr(kmers),'FontSize',7);
set(h,'Rotation',90);
Expand Down

0 comments on commit 1cb111f

Please sign in to comment.