Skip to content

Commit

Permalink
Bins from reclustering are aggreagted from samples, adapted scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] committed Jul 17, 2023
1 parent 2a08c95 commit 8be8368
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 17 deletions.
4 changes: 2 additions & 2 deletions workflow_taxVamb/src/create_cluster_scores_bin_path_dict.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ def get_cluster_score_bin_path(
bin_name = cluster + ".fna"
if bin_name in bins:
cluster_score[cluster] = (com, con)
bin_path[cluster + ".fna"] = os.path.join(
bin_path[cluster + ".fna"] = os.path.abspath(os.path.join(
path_bins, sample, cluster + ".fna"
)
))
return cluster_score, bin_path


Expand Down
3 changes: 2 additions & 1 deletion workflow_taxVamb/src/symlink_nc_bins.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
comp,cont = comp_cont
bin_ = cluster+bin_format
if (comp >= min_comp and cont <= max_cont ):
os.symlink(os.path.join(os.getcwd(),bp_d[bin_]),os.path.join(opt.o,bin_))
#print(bp_d[bin_])
os.symlink(bp_d[bin_],os.path.join(opt.o,bin_))


20 changes: 6 additions & 14 deletions workflow_taxVamb/src/write_clusters_from_final_bins.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,20 @@ while getopts "d:o:" opt; do
esac
done
echo 'creating z y v clusters from the final set of bins'
for s in $(ls $drep_dir)
do
s="$drep_dir"/"$s"/
if [ -d "$s" ]
then
cd $s
cd $drep_dir
for bin in $(ls . 2> /dev/null)

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')
do
echo -e "$cluster_name""\t""$contig" >> $clusters_file
done
echo $cluster_name
#for contig in $(grep '>' $bin | sed 's=>==g')
#do
#echo -e "$cluster_name""\t""$contig" >> $clusters_file
#done


fi
done

fi
done

0 comments on commit 8be8368

Please sign in to comment.