Skip to content

Commit ace36aa

Browse files
authored
Update stargraph.sh
1 parent af1fc0d commit ace36aa

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

bin/stargraph.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -711,17 +711,17 @@ mkdir sourmash_signatures
711711
awk -F " " '{print $1}' ../4.SLR_starship_combination/${prefix}.starships_SLRs.fa > temp.fa
712712
sourmash sketch dna -p k=31,noabund --singleton -o sourmash_signatures/ temp.fa
713713
##first we can get the jaccard similarity
714-
sourmash compare -k 31 sourmash_signatures/*.sig.gz --csv sourmash_signatures.compare_k31.csv
714+
sourmash compare -k 31 sourmash_signatures/*.sig.gz --csv sourmash_signatures.compare_k31.jaccard.csv
715715

716716
##and second we can get the max pairwise containment score
717-
sourmash compare -k 31 sourmash_signatures/*.sig.gz --csv sourmash_signatures.compare_k31.containment.csv
717+
sourmash compare -k 31 sourmash_signatures/*.sig.gz --max-containment --csv sourmash_signatures.compare_k31.containment.csv
718718

719719
##need a very low threshold to remove all very small similarities, here using 10% jaccard similarity
720720
threshold="10"
721721
##generate header for the file that will be used to build the network
722722
echo "to;from;weight" | tr ';' '\t' > ${prefix}.starships_SLRs.pairwise_jaccard.tsv
723723
##now get a list of nonredundant pairwise jaccard similarities
724-
cat sourmash_signatures.compare_k31.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 threshold="$threshold" '{if($3*100 > threshold) {print}}' >> ${prefix}.starships_SLRs.pairwise_jaccard.tsv
724+
cat sourmash_signatures.compare_k31.jaccard.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 threshold="$threshold" '{if($3*100 > threshold) {print}}' >> ${prefix}.starships_SLRs.pairwise_jaccard.tsv
725725

726726
##same but for the containment scores (we used max containment so the pairwise values are symmetric making this easy)
727727
echo "to;from;weight" | tr ';' '\t' > ${prefix}.starships_SLRs.pairwise_containment.tsv

0 commit comments

Comments
 (0)