Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cole/fix status file name #69

Merged
merged 16 commits into from
May 1, 2024
Merged
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/integration_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
with:
repository: edilytics/CRISPResso2_tests
token: ${{ secrets.ACCESS_CRISPRESSO2_TESTS }}
# ref: '<BRANCH-NAME>' # Use this to specify a branch other than master
ref: 'cole/add-file-prefix-to-batch' # Use this to specify a branch other than master

- name: Run Basic
run: |
Expand Down
4 changes: 2 additions & 2 deletions CRISPResso2/CRISPRessoAggregateCORE.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ def main():

parser.add_argument('--debug', help='Show debug messages', action='store_true')
parser.add_argument('-v', '--verbosity', type=int, help='Verbosity level of output to the console (1-4), 4 is the most verbose', default=3)

# CRISPRessoPro params
parser.add_argument('--use_matplotlib', action='store_true',
help='Use matplotlib for plotting instead of plotly/d3 when CRISPRessoPro is installed')
Expand All @@ -98,7 +98,7 @@ def main():

log_filename=_jp('CRISPRessoAggregate_RUNNING_LOG.txt')
logger.addHandler(logging.FileHandler(log_filename))
logger.addHandler(CRISPRessoShared.StatusHandler(_jp('CRISPRessoAggregate_status.json')))
logger.addHandler(CRISPRessoShared.StatusHandler(os.path.join(OUTPUT_DIRECTORY, 'CRISPRessoAggregate_status.json')))

with open(log_filename, 'w+') as outfile:
outfile.write('[Command used]:\n%s\n\n[Execution log]:\n' % ' '.join(sys.argv))
Expand Down
7 changes: 5 additions & 2 deletions CRISPResso2/CRISPRessoBatchCORE.py
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ def main():

log_filename = _jp('CRISPRessoBatch_RUNNING_LOG.txt')
logger.addHandler(logging.FileHandler(log_filename))
status_handler = CRISPRessoShared.StatusHandler(_jp('CRISPRessoBatch_status.json'))
status_handler = CRISPRessoShared.StatusHandler(os.path.join(OUTPUT_DIRECTORY, 'CRISPRessoBatch_status.json'))
logger.addHandler(status_handler)

with open(log_filename, 'w+') as outfile:
Expand Down Expand Up @@ -398,7 +398,10 @@ def main():
large_plot_cutoff = 300

percent_complete_start, percent_complete_end = 90, 99
percent_complete_step = (percent_complete_end - percent_complete_start) / len(all_amplicons)
if all_amplicons:
percent_complete_step = (percent_complete_end - percent_complete_start) / len(all_amplicons)
else:
percent_complete_step = 0
# report for amplicons
for amplicon_index, amplicon_seq in enumerate(all_amplicons):
# only perform comparison if amplicon seen in more than one sample
Expand Down
2 changes: 1 addition & 1 deletion CRISPResso2/CRISPRessoCORE.py
Original file line number Diff line number Diff line change
Expand Up @@ -1288,7 +1288,7 @@ def print_stacktrace_if_debug():
with open(log_filename, 'w+') as outfile:
outfile.write('CRISPResso version %s\n[Command used]:\n%s\n\n[Execution log]:\n' %(CRISPRessoShared.__version__, crispresso_cmd_to_write))

logger.addHandler(CRISPRessoShared.StatusHandler(_jp('CRISPResso_status.json')))
logger.addHandler(CRISPRessoShared.StatusHandler(os.path.join(OUTPUT_DIRECTORY, 'CRISPResso_status.json')))

aln_matrix_loc = os.path.join(_ROOT, "EDNAFULL")
CRISPRessoShared.check_file(aln_matrix_loc)
Expand Down
2 changes: 1 addition & 1 deletion CRISPResso2/CRISPRessoCompareCORE.py
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ def main():

log_filename = _jp('CRISPRessoCompare_RUNNING_LOG.txt')
logger.addHandler(logging.FileHandler(log_filename))
logger.addHandler(CRISPRessoShared.StatusHandler(_jp('CRISPRessoCompare_status.json')))
logger.addHandler(CRISPRessoShared.StatusHandler(os.path.join(OUTPUT_DIRECTORY, 'CRISPRessoCompare_status.json')))

with open(log_filename, 'w+') as outfile:
outfile.write('[Command used]:\nCRISPRessoCompare %s\n\n[Execution log]:\n' % ' '.join(sys.argv))
Expand Down
2 changes: 1 addition & 1 deletion CRISPResso2/CRISPRessoMetaCORE.py
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ def main():

log_filename=_jp('CRISPRessoMeta_RUNNING_LOG.txt')
logger.addHandler(logging.FileHandler(log_filename))
logger.addHandler(CRISPRessoShared.StatusHandler(_jp('CRISPRessoMeta_status.json')))
logger.addHandler(CRISPRessoShared.StatusHandler(os.path.join(OUTPUT_DIRECTORY, 'CRISPRessoMeta_status.json')))

with open(log_filename, 'w+') as outfile:
outfile.write('[Command used]:\n%s\n\n[Execution log]:\n' % ' '.join(sys.argv))
Expand Down
2 changes: 1 addition & 1 deletion CRISPResso2/CRISPRessoPooledCORE.py
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ def main():

log_filename = _jp('CRISPRessoPooled_RUNNING_LOG.txt')
logger.addHandler(logging.FileHandler(log_filename))
logger.addHandler(CRISPRessoShared.StatusHandler(_jp('CRISPRessoPooled_status.json')))
logger.addHandler(CRISPRessoShared.StatusHandler(os.path.join(OUTPUT_DIRECTORY, 'CRISPRessoPooled_status.json')))

if args.zip_output and not args.place_report_in_output_folder:
logger.warn('Invalid arguement combination: If zip_output is True then place_report_in_output_folder must also be True. Setting place_report_in_output_folder to True.')
Expand Down
2 changes: 1 addition & 1 deletion CRISPResso2/CRISPRessoPooledWGSCompareCORE.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ def main():

log_filename = _jp('CRISPRessoPooledWGSCompare_RUNNING_LOG.txt')
logger.addHandler(logging.FileHandler(log_filename))
logger.addHandler(CRISPRessoShared.StatusHandler(_jp('CRISPRessoPooledWGSCompare_status.json')))
logger.addHandler(CRISPRessoShared.StatusHandler(os.path.join(OUTPUT_DIRECTORY, 'CRISPRessoPooledWGSCompare_status.json')))

with open(log_filename, 'w+') as outfile:
outfile.write(
Expand Down
8 changes: 5 additions & 3 deletions CRISPResso2/CRISPRessoShared.py
Original file line number Diff line number Diff line change
Expand Up @@ -1856,9 +1856,11 @@ def check_custom_config(args):
custom_config['colors'] = config['colors']

return custom_config
except Exception as e:
logger.warn("Cannot read json file '%s', defaulting config parameters." % args.config_file)
print(e)
except Exception:
if args.config_file:
logger.warn("Cannot read config file '%s', defaulting config parameters." % args.config_file)
else:
logger.warn("No config file provided, defaulting config parameters.")
return config


Expand Down
2 changes: 1 addition & 1 deletion CRISPResso2/CRISPRessoWGSCORE.py
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ def print_stacktrace_if_debug():
except:
warn('Folder %s already exists.' % OUTPUT_DIRECTORY)

logger.addHandler(CRISPRessoShared.StatusHandler(_jp('CRISPRessoWGS_status.json')))
logger.addHandler(CRISPRessoShared.StatusHandler(os.path.join(OUTPUT_DIRECTORY, 'CRISPRessoWGS_status.json')))

info('Checking dependencies...')

Expand Down
Loading