mourisl/Rascaf

rascaf-join parsing previous rascaf command

pickettbd opened this issue · 3 comments

rascaf-join uses the output from rascaf to determine whether the assembly was contig level and access the input assembly fasta file. It does this by searching for "-f" in the string that is obtained by searching for the line that begins with "command line:". The same approach is used to find the parameter provided to "-breakN" and "-b". This causes issues when file paths include hyphens followed by an f or a b. For example, if the path to the rascaf-join executable is "/home/username/blah-blah/rascaf/rascaf-join", the path to the bam file will be stored as "lah/rascaf/rascaf-join". This file will not be found and will result in a segmentation fault.

I was able to fix this problem for myself by altering the code to search for " -f", " -b", and " -breakN" (and incrementing the pointer increment by one). However, this fix is tenuous and is why I chose not to fork and make a pull request. More careful parsing would help, but another option would be to have the user provide the needed information at the command line (as a user- I would prefer this option). This would require a brief explanation in the README, but should be fairly simple for a user to understand. This is not super urgent (at least not for me), but I thought I'd throw the friendly suggestion out there.

Thank you!!!! It would be impossible for me to find this bug <3.
I just updated rascaf-join to have a more robust parsing for the parameters.

You're welcome! I'm glad I could help. I used my fix before, but I just use rascaf-join again using the new code you wrote. You use realpath to get the resolved path of the output file as parsed from "-f" from the rascaf run. If my understanding is correct, the issue now is that realpath returns NULL when the file does not exist. This is a reasonable likelihood for a new output file and so this check should probably be modified. I was able to get around it by using touch to create the file in advance and then run rascaf-join.

Woops, I made a silly mistake in that part. The new version should fix this issue. Thanks for pointing this out.