bsipos / uncle_psl

A BLAT (PSL) to SAM converter.
Mozilla Public License 2.0
7 stars 5 forks source link

Issues in obtaining [outfile] #4

Closed AnnaAMonaco closed 4 years ago

AnnaAMonaco commented 4 years ago

Hi,

Background: I am trying to lift a BAM file over from the genome space of one species of Drosophila to another. I converted the species1.bam to species1.psl (with UCSC bamToPsl), using the -fasta option to write out species1.fa. After liftover with pslMap I have my species1_to_species2_over.psl, that I need to convert back to BAM and most importantly I need to write the sequence from species1.fa in it. I am working with sequence variants so this step is fundamental.

Code: sampleName=species1_to_species2_over uncle_psl.py -f species1.fa species1_to_species2_over.psl $sampleName.sam | samtools view -T -b > $sampleName.bam

Issue: In: usage: uncle_psl.py [-h] [-f reads_fasta] [-N n_limit] [-H] [infile] [outfile] It is not clear to me if and how the [outfile] is to be specified, since I have tried in many different ways: either making and empty file for it to write in, or just specifying a root name to write, or not specifying anything at all. When I don't specify and [outfile] it writes and empty ".sam" file, when I do I always get the following error message (and an empty SAM file): usage: uncle_psl.py [-h] [-f reads_fasta] [-N n_limit] [-H] [infile] [outfile] uncle_psl.py: error: argument infile: can't open 'species1_to_species2_over': [Errno 2] No such file or directory: 'species1_to_species2_over'

So how should the [outfile] be specified in order for it to write the SAM file?

Details: I installed your tool as indicated here https://github.com/bsipos/uncle_psl in its own conda environment with samtools. I'm working on a HPC cluster running on CentOS Linux 7.

PS. I have also tried just running uncle_psl.py -f species1.fa species1_to_species2_over.psl $sampleName.sam and encounter the same issues.

bsipos commented 4 years ago

Please try just this:

uncle_psl.py -f species1.fa species1_to_species2_over.psl output.sam

Piping into samtools would not make sense as the output goes to output.sam.