Skip to content
Snippets Groups Projects
Commit b51698d6 authored by mrethore's avatar mrethore
Browse files

Merge branch 'absolute_paths' into 'main'

Absolute paths

See merge request !10
parents 95ce8aaa 1147a370
No related branches found
No related tags found
1 merge request!10Absolute paths
...@@ -342,19 +342,17 @@ if __name__ == "__main__": ...@@ -342,19 +342,17 @@ if __name__ == "__main__":
basename = os.path.basename(genome) basename = os.path.basename(genome)
strain = os.path.splitext(basename)[0] strain = os.path.splitext(basename)[0]
fasta = f"{get_path}/{genome}" dict_genome = get_species_results(genome, args.path + '/data/species', str(args.threads))
dict_genome = get_species_results(fasta, args.path + '/data/species', str(args.threads))
if args.mlst : if args.mlst :
cd_complex = is_cd_complex(dict_genome) cd_complex = is_cd_complex(dict_genome)
dict_genome.update(get_chromosome_mlst_results(MLST_db, fasta, cd_complex, args)) dict_genome.update(get_chromosome_mlst_results(MLST_db, genome, cd_complex, args))
if args.tox : if args.tox :
dict_genome.update(get_tox_results(TOX_db, fasta, args)) dict_genome.update(get_tox_results(TOX_db, genome, args))
if args.resistance_virulence : if args.resistance_virulence :
min_identity = "-1" # Defaut amrfinder min_identity = "-1" # Defaut amrfinder
os.system('amrfinder --nucleotide ' + fasta + os.system('amrfinder --nucleotide ' + genome +
' --name '+strain+ ' --name '+strain+
' --nucleotide_output ' + args.outdir + "/" + strain + ".prot.fa" + ' --nucleotide_output ' + args.outdir + "/" + strain + ".prot.fa" +
' --output '+ args.outdir + "/" + strain + ".blast.out" + ' --output '+ args.outdir + "/" + strain + ".blast.out" +
...@@ -377,7 +375,7 @@ if __name__ == "__main__": ...@@ -377,7 +375,7 @@ if __name__ == "__main__":
if args.integron : if args.integron :
os.system('integron_finder --cpu ' + str(args.threads)+ os.system('integron_finder --cpu ' + str(args.threads)+
' --outdir '+ args.outdir + "/" + ' --outdir '+ args.outdir + "/" +
' --gbk --func-annot --mute '+ fasta) ' --gbk --func-annot --mute '+ genome)
os.system('find '+ args.outdir + "/Results_Integron_Finder_*/ " + '-empty -type d -delete') os.system('find '+ args.outdir + "/Results_Integron_Finder_*/ " + '-empty -type d -delete')
files = pd.read_csv(args.outdir + "/Results_Integron_Finder_"+strain + "/" + strain+".summary",sep="\t", index_col=0, skiprows = 1) files = pd.read_csv(args.outdir + "/Results_Integron_Finder_"+strain + "/" + strain+".summary",sep="\t", index_col=0, skiprows = 1)
......
...@@ -3,8 +3,8 @@ ...@@ -3,8 +3,8 @@
PATH_DB=$(dirname "$0") PATH_DB=$(dirname "$0")
DATE=$(date "+%Y-%m-%d") DATE=$(date "+%Y-%m-%d")
## Update Antimicrobial_resistance/AMRFinderPlus ## Update Antimicrobial_resistance/AMRFinderPlus
wget --quiet --recursive --no-host-directories --cut-dirs=6 ftp://ftp.ncbi.nlm.nih.gov/pathogen/Antimicrobial_resistance/AMRFinderPlus/database/latest/ -P $PATH_DB/$DATE
wget --quiet --recursive --no-parent --no-host-directories --cut-dirs=6 -e robots=off https://ftp.ncbi.nlm.nih.gov/pathogen/Antimicrobial_resistance/AMRFinderPlus/database/latest/ -P $PATH_DB/$DATE
version_DB=$(cat $PATH_DB/$DATE/version.txt) version_DB=$(cat $PATH_DB/$DATE/version.txt)
echo "Looking up databases at https://ftp.ncbi.nlm.nih.gov/pathogen/Antimicrobial_resistance/AMRFinderPlus/database/" echo "Looking up databases at https://ftp.ncbi.nlm.nih.gov/pathogen/Antimicrobial_resistance/AMRFinderPlus/database/"
echo "Downloading AMRFinder database version $version_DB" echo "Downloading AMRFinder database version $version_DB"
...@@ -38,6 +38,4 @@ echo -e "Corynebacterium_diphtheriae\tCorynebacterium_diphtheriae\t0" >> $PATH_D ...@@ -38,6 +38,4 @@ echo -e "Corynebacterium_diphtheriae\tCorynebacterium_diphtheriae\t0" >> $PATH_D
PATH_DB="$PATH_DB/$DATE" PATH_DB="$PATH_DB/$DATE"
VERSION="$DATE" VERSION="$DATE"
echo "Database directory: '$PATH_DB'" echo "Database directory: '$PATH_DB'"
echo "Database version: $DATE.1" echo "Database version: $DATE.1"
\ No newline at end of file
...@@ -18,5 +18,4 @@ def update_database(arguments, mlst_database:tuple, tox_database:tuple): ...@@ -18,5 +18,4 @@ def update_database(arguments, mlst_database:tuple, tox_database:tuple):
print(" ... done \n") print(" ... done \n")
os.system('bash ' + arguments.path + '/data/resistance/update_database_resistance.sh') os.system('bash ' + arguments.path + '/data/resistance/update_database_resistance.sh')
print(" ... done \n\n\n") print(" ... done \n\n\n")
\ No newline at end of file
\ No newline at end of file
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment