Skip to content

Commit

Permalink
Dthoward96 bugfix (#45)
Browse files Browse the repository at this point in the history
* Update report.py

Bug fix to allow for other submit folders in FTP of ncbi

* Update process.py

bug fix for capitalization of folder name
  • Loading branch information
dthoward96 authored Mar 12, 2024
1 parent 3f6433d commit de80b48
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion process.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ def update_submission_status(submission_dir, submission_name, organism, test):
if test == True:
submission_type = "Test"
else:
submission_type = "production"
submission_type = "Production"
# Check if given organism exist in the log
df_partial = df.loc[(df["Organism"] == organism) & (df["Submission_Name"] == submission_name) & (df["Submission_Directory"] == submission_dir) & (df["Submission_Type"] == submission_type)]
if df_partial.shape[0] == 0:
Expand Down
11 changes: 10 additions & 1 deletion report.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,16 @@ def get_ncbi_process_report(database, submission_name, submission_files_dir, con
FTP_HOST = process.get_main_config()["PORTAL_NAMES"]["NCBI"]["FTP_HOST"]
ftp = ftplib.FTP(FTP_HOST)
ftp.login(user=config_dict["Username"], passwd=config_dict["Password"])
# CD to to test or production folder
# Check if submit folder exists
if "submit" in ftp.nlst():
ftp.cwd("submit")
# If submit folder exists check if Production/Test folder exists
if submission_type not in ftp.nlst():
print("Error: Cannot find submission folder on NCBI FTP site.", file=sys.stderr)
sys.exit(1)
else:
print("Error: Cannot find submission folder on NCBI FTP site.", file=sys.stderr)
sys.exit(1)
ftp.cwd(submission_type)
# Check if submission name exists
if ncbi_submission_name not in ftp.nlst():
Expand Down

0 comments on commit de80b48

Please sign in to comment.