Quantcast
Channel: Ask the FireCloud Team — GATK-Forum
Viewing all articles
Browse latest Browse all 1147

write_lines lacks newline at end of file?

$
0
0

I have a task that uses "write_lines" that I've run in FC. See the WDL below.

task wl_task {

Array[String] some_data
File data_lines=write_lines(some_data)

command <<<

set -x
echo "array data no ne" ;
echo "${sep=" " some_data}" ; 
echo "array data with ne" ; 
echo -ne "${sep=" "some_data}" ;

echo "file data" ;
cat ${data_lines}
echo "grep data" ;
grep -Pin '.' ${data_lines}
echo "line count" ; 
wc -l ${data_lines}


>>>

runtime {
    docker : "ubuntu"
    disks: "local-disk 1 HDD"
    memory: "0.1 GB"
    }

}


workflow wl_wf {

call wl_task

}

When I run the WDL with .tmp file written shows "1" if I cat it using gsutil cat output piped to wc -l. This is though the array of data used has two items in it. Is this the proper behavior? When using the write_lines written file in a script I was getting unexpected line counts and that's how I noticed this behavior. In the snippet below, I show a GSURL of the written file. I cat it, and then I show the result of a line count with "wc -l". After the "cat" you can see the "1" on the same line as the last line of the "cat". That's where I would expect a newline to be to be followed by a "2".

wm8b1-75c:qc_pon_wdl esalinas$ URL="gs://fc-638a3626-ca10-4be8-8837-9f2ab4039a12/baca3499-d124-4f55-afa1-2050a728fe7e/wl_wf/2ac5a1ab-ecef-488d-9e0c-489358543b18/call-wl_task/write_lines_958247eb3828e70c2d374595a50eb375.tmp" && gsutil cat $URL && gsutil cat $URL|wc -l 
HCC1143_Normal_100_gene_250bp_pad
HCC1954_Normal_100_gene_250bp_pad       1
wm8b1-75c:qc_pon_wdl esalinas$ 



Viewing all articles
Browse latest Browse all 1147

Trending Articles