ufcg
ufcg copied to clipboard
Metadata file checking fails when .tsv is symbolic link
Hi, this is less of a bug and more of an unexpected behaviour! Posting here so others who might have had this issue know a fix.
I'm using ufcg
with the v1.0.5
container in Nextflow. Nextflow executes each software process in a separate work
directory and passes input files into this directory via symbolic links, rather than copying them over. For my purposes, I was supplying the metadata.tsv
file via an input channel, which meant it was a symbolic link, and ufcg
wasn't liking it:
__ __ _____ _____ _____
/ / / // ___// ___// ___/
/ / / // /_ / / / / __
/ /_/ // __/ / /___/ /_/ /
\____//_/ \____/\____/ v1.0.5
[JUN 24 00:54:18] UFCG |: Verbose option check.
[JUN 24 00:54:18] UFCG |: Timestamp printing option check.
[JUN 24 00:54:18] UFCG |: Input file check : GCA_013839505.1_ASM1383950v1_genomic.fna
[JUN 24 00:54:18] UFCG |: Input argument : symbolic link to /group/pathogens/IAWS/Personal/JackS/dev/fungal-phylo/work/a4/656055c898c37762af308a88ba3c0e/GCA_013839505.1_ASM1383950v1_genomic.fna
[JUN 24 00:54:18] UFCG |: Output directory check : .
[JUN 24 00:54:18] UFCG |: Temporary directory check : /tmp/GCA_013839505.1
[JUN 24 00:54:18] UFCG |: Custom CPU thread count check : 1
[JUN 24 00:54:18] UFCG |: Metadata file check : repository_metadata.tsv
[JUN 24 00:54:18] UFCG |: ERROR! Invalid file given : repository_metadata.tsv
[JUN 24 00:54:18] UFCG |: Run with "profile -h" option to see the user manual.
The fix is to use the readlink
command in bash to convert the symbolic path (here repository_metadata.tsv
) to an absolute path:
META_PATH=$(readlink repository_metadata.tsv -fn)
...and then use this as the metadata file path in ufcg
:
ufcg profile -i ./input -o ./output -m $META_PATH
Because the fix is so easy in bash, not sure if it's worth trying to fix this within ufcg
, but might be worth adding a note to the documentation? Although it is strange to me that ufcg
recognises and allows input files to be symbolic links (see output above).