Sam output file confusion

Issue #50 resolved
Jane Lucas created an issue

Hi All,

I am new to this type of sequencing analysis and am having some issue with my results interpretation. My general goal is to see how many times a specific resistant gene occurs in my sample. Is this something I can do with KMA, or is the output just a list of the genes aligned, and not how frequent they are present?

Additionally, because most of my previous experience is working with BAM and SAM files, I would like to be able to have this program create SAM outputs. I see that there is an option to do this, but I am continually having errors with how to correctly code this.

Here is my normal line of code that works well.

kma -ipe HCJWJBBXY/3354/Trim/2c_output_forward_paired.fq.gz HCJWJBBXY/3354/Trim/2c_output_reverse_paired.fq.gz -o 2ctrial_kma -t_db templates

Can someone provide insight on how to modify this to get a SAM output?

Comments (4)

  1. ptlcc

    Hi Jane

    If you add the “-sam” flag it will produce tha sam-output, and send it to stdout.
    Since you seemingly have Illumina data, the “-1t1” flag would be advantageous as well.

    You can list all the options with the “-h” flag, where most of these have a more thorough explanation in the “KMAspecification.pdf“ file available with the source code.

    Best,
    Philip

  2. Jane Lucas reporter

    Hi Philip,

    Thanks for your response. My issue is that when I run the -sam flag, I get a huge output of the whole sam file in my terminal screen, but it won’t save this information to an output file. And, when I use the -sam flag and put a file name after it I get an invalid argument error.

    kma -ipe HCJWJBBXY/3354/Trim/2c_output_forward_unpaired.fq.gz HCJWJBBXY/3354/Trim/2c_output_reverse_unpaired.fq.gz -o 2ctrialunpaired_kma.sam -t_db templates -ef -1t1 -sam 2c.sam

    Invalid argument at "-sam".

    Any thoughts on what I am doing wrong?

    Thanks

    Jane

  3. ptlcc

    Hi Jane

    In that case you need to redirect the output, like this:

    kma -ipe HCJWJBBXY/3354/Trim/2c_output_forward_unpaired.fq.gz HCJWJBBXY/3354/Trim/2c_output_reverse_unpaired.fq.gz -o 2ctrialunpaired_kma.sam -t_db templates -ef -1t1 -sam > 2c.sam

    You can also redirect to bam with this:

    kma -ipe HCJWJBBXY/3354/Trim/2c_output_forward_unpaired.fq.gz HCJWJBBXY/3354/Trim/2c_output_reverse_unpaired.fq.gz -o 2ctrialunpaired_kma.sam -t_db templates -ef -1t1 -sam | samtools -bS - > 2c.sam

    Best,
    Philip

  4. Log in to comment