Skip to content

Commit

Permalink
Update write_clusters_from_dereplicated_and_ripped_bins.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
Paupiera committed Oct 30, 2023
1 parent aa45d9b commit 5389c1b
Showing 1 changed file with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,15 +1,13 @@
#!/usr/bin/bash


while getopts "d:o:" opt; do
case $opt in
d) drep_dir=$OPTARG ;;
o) outdir=$OPTARG ;;
o) clusters_file=$OPTARG ;;
*) echo 'error' >&2
exit 1
esac
done
clusters_file=${outdir}/avamb/avamb_manual_drep_disjoint_clusters.tsv
output_file=$(pwd)/${clusters_file}/avamb/avamb_manual_drep_disjoint_clusters.tsv
echo 'creating z y v clusters from the final set of bins'
for s in $(ls $drep_dir)
do
Expand All @@ -19,20 +17,20 @@ then
cd $s
for bin in $(ls . 2> /dev/null)

do
do
if [[ $bin == **".fna" ]]
then

cluster_name=$(echo $bin | sed 's=.fna==g' | sed 's=.fa==g')

for contig in $(grep '>' $bin | sed 's=>==g')
for contig in $(grep '>' $bin | sed 's=>==g')
do
echo -e "$cluster_name""\t""$contig" >> $clusters_file
echo -e "$cluster_name""\t""$contig" >> $output_file
done


fi
done

fi
done
done

0 comments on commit 5389c1b

Please sign in to comment.