Skip to content

Commit

Permalink
Bug fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
ssjunnebo committed Sep 25, 2024
1 parent 9e80a4f commit 23e9b64
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
6 changes: 3 additions & 3 deletions taca/analysis/analysis_element.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,21 +85,21 @@ def _process(run):
demux_results_dirs = glob.glob(
os.path.join(run.run_dir, "Delmultiplexing*")
)
if len(demux_results_dirs > 1):
if len(demux_results_dirs) > 1:
run.aggregate_demux_results(demux_results_dirs)
run.sync_metadata()
run.make_transfer_indicator()
run.status = "transferring"
if run.status_changed:
run.update_statusdb()
# TODO: Also update statusdb with a timestamp of when the transfer started
run.transfer() # I think this should be a detached command as well
run.transfer()
return
elif transfer_status == "ongoing":
run.status = "transferring"
if run.status_changed:
run.update_statusdb()
logger.info(f"{run} is being transferred. Skipping.")
logger.info(f"{run} is being transferred. Skipping.") # TODO: fix formatting, currently prints "ElementRun(20240910_AV242106_B2403418431) is being transferred"
return
elif transfer_status == "rsync done":
if run.rsync_successful():
Expand Down
9 changes: 5 additions & 4 deletions taca/element/Element_Runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ def rsync_complete(self):
def rsync_successful(self):
with open(os.path.join(self.run_dir, ".rsync_exit_status")) as rsync_exit_file:
rsync_exit_status = rsync_exit_file.readlines()
if rsync_exit_status[0].strip() == 0:
if rsync_exit_status[0].strip() == '0':
return True
else:
return False
Expand Down Expand Up @@ -522,7 +522,7 @@ def make_transfer_indicator(self):

def transfer(self):
transfer_details = (
self.CONFIG.get("element_analysis").get(self.sequencer_type).get("transfer_details")
self.CONFIG.get("element_analysis").get("transfer_details")
) # TODO: Add section to taca.yaml
command = (
"rsync"
Expand All @@ -532,8 +532,8 @@ def transfer(self):
+ " --exclude BaseCalls" # TODO: check that we actually want to exclude these
+ " --exclude Alignment"
+ f" {self.run_dir}"
+ f" {transfer_details.get('user')@transfer_details.get('host')}:/aviti"
+ "; echo $? > .rsync_exit_status"
+ f" {transfer_details.get('user')}@{transfer_details.get('host')}:/aviti"
+ f"; echo $? > {os.path.join(self.run_dir, ".rsync_exit_status")}"
) # TODO: any other options?
try:
p_handle = subprocess.Popen(command, stdout=subprocess.PIPE, shell=True)
Expand Down Expand Up @@ -568,3 +568,4 @@ def archive(self):
src = self.run_dir
dst = os.path.join(self.run_dir, os.pardir, "nosync")
shutil.move(src, dst)
self.run_dir =

0 comments on commit 23e9b64

Please sign in to comment.