MonashBioinformaticsPlatform/polyApipe

polyApipe.py cannot take symbolic links as input

cattapre opened this issue · 4 comments

I need to use symbolic links as input files to polyApipes, but have been unable to.
Could you please help?
Thanks

pfh commented

Hi cattapre. I often use a directory of symbolic links as input to polyApipe.py myself, so I'm not sure what has gone wrong. Can you give me some more details, such as arguments you gave to polyApipe.py or an error message.

Hi pfh, thanks for your reply. When I try to run polyApipe.py and point the input to a symbolic link, I receive a message that the file does not exist. Please see example below:
I entered ...
polyApipe.py -i ../data/bamFiles/fileList/ -o "consolidated.${fileHash}" --no_count

and received ...
File ../data/bamFiles/fileList/possorted_genome_bam.bam does not exist
where possorted_genome_bam.bam is a symbolic link.
When I have the actual file on that folder, it runs fine.
Could you please help? Thanks

pfh commented

Ok, that message is based on os.path.exists. I've just checked, and this function will return True for symlinks, unless they are broken.

Maybe give me an "ls -l" of the "fileList" directory, and also check that other software such as samtools is able to read the symlink.

Ok, that message is based on os.path.exists. I've just checked, and this function will return True for symlinks, unless they are broken.

Maybe give me an "ls -l" of the "fileList" directory, and also check that other software such as samtools is able to read the symlink

You got it. the problem is that your code (just like samtools) for some reason is not reading relative file references, only absolute ones. For samtools, it was described in http://seqanswers.com/forums/showthread.php?t=43299

Thanks, now it is working.