Skip to content

Commit 10ea5c8

Browse files
authored
Update stargraph.sh
1 parent a34dbe1 commit 10ea5c8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

bin/stargraph.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,8 +418,9 @@ sourmash sketch dna -p scaled=100,k=21 ${prefix}.SLRs.fa --singleton -o ${prefix
418418
##now compare it against itself using 'containment' as the metrix (this allows us to easily find smaller elements nested within larger ones)
419419
##here we only use the maximum containment value for any pairwise comparison and therefore keeping the table symmetric
420420
sourmash compare ${prefix}.SLRs.sig --max-containment --csv ${prefix}.SLRs.sig.compare.csv --labels-to ${prefix}.SLRs.sig.compare.txt
421-
##convert to pairwise comparisons and change all values below 10% to 0
422-
cat ${prefix}.SLRs.sig.compare.csv | tr -d '\r' | awk -F',' 'NR==1{for(i=1;i<=NF;i++)samples[i]=$i;next}{row=NR-1;for(i=row+1;i<=NF;i++)print samples[row],samples[i],$i}' OFS='\t' | awk -F "\t" '{if($3 >= 0.1) {print} else {print $1"\t"$2"\t0"}}' > ${prefix}.SLRs.sig.pairwise.tsv
421+
##convert to pairwise comparisons and change all values below 25% to 0
422+
minjac="0.25"
423+
cat ${prefix}.SLRs.sig.compare.csv | tr -d '\r' | awk -F',' 'NR==1{for(i=1;i<=NF;i++)samples[i]=$i;next}{row=NR-1;for(i=row+1;i<=NF;i++)print samples[row],samples[i],$i}' OFS='\t' | awk -F "\t" -v minjac="$minjac" '{if($3 >= minjac) {print} else {print $1"\t"$2"\t0"}}' > ${prefix}.SLRs.sig.pairwise.tsv
423424
##now use mcl to quickly find the clusters
424425
mcl ${prefix}.SLRs.sig.pairwise.tsv --abc -o ${prefix}.SLRs.sig.pairwise.mcl.txt
425426
##now name the clusters and then append to the summary files

0 commit comments

Comments
 (0)