In a python script I gave a call in this way:

do.call([cfg.tool_cmd("cuffdiff"),
"-p", str(cfg.project["analysis"]["threads"]),
"-b", str(cfg.project["genome"]["fasta"]),
"-u", cfg.project["experiment"]["merged"],
"-L", "%s,%s" % (str(cfg.project["phenotype"][0])[2:8],str(cfg.project["phenotype"][1])[2:7]),
"-o", output_folder] + [cfg.project["samples"][0]["files"]["bam"] + ' ' + cfg.project["samples"][1]["files"]["bam"]], cfg.project["analysis"]["log_file"])

This gives the command:

Command '['/usr/local/bin/cuffdiff', '-p', '5', '-b', '/scratchsan/venkatesh/TuxedoProject/data/genome/ce10.fa', '-u', 'pipeline/merging/merged.gtf', '-L', 'embryo,larva', '-o', 'pipeline/degenes', 'pipeline/SAMN00990702-1/mappings/accepted_hits.bam pipeline/SAMN00990702-2/mappings/accepted_hits.bam']' returned non-zero exit status 1

In this command the bam files are separated with space but they are taken as one.
'pipeline/SAMN00990702-1/mappings/accepted_hits.bam pipeline/SAMN00990702-2/mappings/accepted_hits.bam'

I want this to be like:
'pipeline/SAMN00990702-1/mappings/accepted_hits.bam' 'pipeline/SAMN00990702-2/mappings/accepted_hits.bam'

CAn anyone help me !! Thankyou !!

Replace +''+ with ,. Why didn't you use next(iter(...)) as I told you ?

If I use , in the place of +''+ It gave this:

'/usr/local/bin/cuffdiff', '-p', '5', '-b', '/scratchsan/venkatesh/TuxedoProject/data/genome/ce10.fa', '-u', 'pipeline/merging/merged.gtf', '-L', 'embryo,larva', '-o', 'pipeline/degenes', 'pipeline/SAMN00990702-1/mappings/accepted_hits.bam', 'pipeline/SAMN00990702-2/mappings/accepted_hits.bam'

You can see here bam files are separated with comma. I want them to be separated with space.

If I use next(iter(...)) it is giving many errors.

If I use , in the place of +''+ It gave this

You need to be precise. The output you are showing separates every arguments with a comma. Where does it come from ? Did you print some python variable ? How is this command used ? So please explain what you mean by it gave this. For example in a python list ['a', 'b'] there is a comma, but it is only a representation of the list.It does not mean that 'a' and 'b' are separated by a comma.

If I use next(iter(...)) it is giving many errors

Again, can you post the error message ?

Others are fine only for bam files it should look like this:

'pipeline/SAMN00990702-1/mappings/accepted_hits.bam' 'pipeline/SAMN00990702-2/mappings/accepted_hits.bam'

but it is

'pipeline/SAMN00990702-1/mappings/accepted_hits.bam','pipeline/SAMN00990702-2/mappings/accepted_hits.bam'. So, I don't need in this way.

Anyways I got the answer !! Thankyou !!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.