Skip to content

Commit

Permalink
Removed the bash careful mode as it created issues with Ubuntu users.…
Browse files Browse the repository at this point in the history
… Replaced a bash command for changing column orders in tabular files with a python script
  • Loading branch information
hjruscheweyh committed Apr 26, 2023
1 parent 4f09451 commit dd15f79
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion mOTUs-extender/extend_mOTUs_addGenome.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set -euxo pipefail
#set -euxo pipefail
#add genomes to mOTU DB

sequence_file=$1
Expand Down
2 changes: 1 addition & 1 deletion mOTUs-extender/extend_mOTUs_addMarkerGenes.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set -euxo pipefail
#set -euxo pipefail
#add genomes to mOTU DB

sequence_file=$1
Expand Down
5 changes: 3 additions & 2 deletions mOTUs-extender/extend_mOTUs_generateDB.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
set -euxo pipefail
#set -euxo pipefail
#filter genomes from mOTU DB


Expand Down Expand Up @@ -155,7 +155,8 @@ do
paste $new_database_folder/$newDBName/vsearch/$newDBName.mOTU-LG.map.tsv.temp1 $new_database_folder/$newDBName/vsearch/$newDBName.mOTU-LG.map.tsv.temp1 | sed "s/^/${line}./"
done < $mOTU_MG_file > $new_database_folder/$newDBName/vsearch/$newDBName.mOTU-LG.map.tsv

awk -F $'\t' ' { t = $1; $1 = $2; $2 = t; print; } ' OFS=$'\t' $new_database_folder/$newDBName/vsearch/$newDBName.mOTU-LG.map.tsv > $new_database_folder/$newDBName/vsearch/$newDBName.mOTU-LG.map.tsv.temp
python $scriptDir/swap_columns.py $new_database_folder/$newDBName/vsearch/$newDBName.mOTU-LG.map.tsv > $new_database_folder/$newDBName/vsearch/$newDBName.mOTU-LG.map.tsv.temp
#awk -F $'\t' ' { t = $1; $1 = $2; $2 = t; print; } ' OFS=$'\t' $new_database_folder/$newDBName/vsearch/$newDBName.mOTU-LG.map.tsv > $new_database_folder/$newDBName/vsearch/$newDBName.mOTU-LG.map.tsv.temp

python $scriptDir/reformatMapping2Clustering.py $new_database_folder/$newDBName/vsearch/$newDBName.mOTU-LG.map.tsv.temp $new_database_folder/$newDBName/vsearch/$newDBName.mOTU-LG.map.line.tsv

Expand Down
6 changes: 6 additions & 0 deletions mOTUs-extender/swap_columns.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import sys

with open(sys.argv[1]) as handle:
for line in handle:
splits = line.strip().split()
print(f'{splits[1]}\t{splits[0]}')

0 comments on commit dd15f79

Please sign in to comment.