This is a test version of Biostars. For the public version, visit https://www.biostars.org.
convert sam format to axt Format

hello,
I would like to convert my sam file (.sam) to another type is .axt format.
i used BWA for alignement but the output of this tool is .sam format.
Can you help me?
Thanks

alignment sam axtformat

yes. it support indels

so, how does it look likes with indels, I cannot find an example

this is an example:

14 NODE_98_length_11049_ID_45456 4251 4311 Read_10 8190 8248 - 3854
aaatgtattccgataggccattttacatttggagggacggttgaaag---tggacagaggaaaa
aaatgtattccgatagg----tttacatttggagg-acggttgaaagacttggacagaggaaaa

so how convert .sam output to .axt?

i cant install ant in my server!!! have you solution?

I installed apache.

but no run to biostar170742.

[mk@rainman jvarkit]$ /home/mk/apache-ant-1.9.6/bin/ant -version
Apache Ant version 1.7.1 compiled on August 24 2010
[mk@rainman jvarkit]$ make biostar170742
echo "Compiling htsjdk with ${JAVA_HOME} = "
Compiling htsjdk with  =
echo "Compiling htsjdk library for java. Requires  apache ANT. If it fails here, it's a not a problem with jvarkit."
Compiling htsjdk library for java. Requires  apache ANT. If it fails here, it's a not a problem with jvarkit.
echo "And ${JAVA_HOME}/bin/javac should be >=1.8"
And /bin/javac should be >=1.8
(cd /home/mk/jvarkit/htsjdk-2.0.1 && ant )
Buildfile: build.xml

write-version-property:

BUILD FAILED
/home/mk/jvarkit/htsjdk-2.0.1/build.xml:64: Problem: failed to create task or type propertyfile
Cause: the class org.apache.tools.ant.taskdefs.optional.PropertyFile was not found.
        This looks like one of Ant's optional components.
Action: Check that the appropriate optional JAR exists in
        -/usr/share/ant/lib
        -/home/mk/.ant/lib
        -a directory added on the command line with the -lib argument

Do not panic, this is a common problem.
The commonest cause is a missing JAR.

This is not a bug; it is a configuration problem

Total time: 0 seconds
make: *** [/home/mk/jvarkit/htsjdk-2.0.1/dist/htsjdk-2.0.1.jar] Erreur 1
[mk@rainman jvarkit]$

thank you but I cant install apache. I don't know the problem

have you another solution to run samtoaxt.java?

Thanks

1 answer

I quickly wrote a converter https://github.com/lindenb/jvarkit/wiki/Biostar170742

$ java -jar dist-2.0.1/biostar170742.jar \
    -R ref.fa \
    S1.bam

0 rotavirus 1 70 rotavirus_1_317_5:0:0_7:0:0_2de/1 + 60
GGCTTTTAATGCTTTTCAGTGGTTGCTGCTCAAGATGGAGTCTACTCAGCAGATGGTAAGCTCTATTATT
GGCTTTTAATGCTTTTCAGTGGTTGCTGCTCAATATGGCGTCAACTCAGCAGATGGTCAGCTCTAATATT

1 rotavirus 1 70 rotavirus_1_535_4:0:0_4:0:0_1a6/2 + 60
GGCTTTTAATGCTTTTCAGTGGTTGCTGCTCAAGATGGAGTCTACTCAGCAGATGGTAAGCTCTATTATT
GGCTTTTACTGCTTTTCAGTGGTTGCTTCTCAAGATGGAGTGTACTCATCAGATGGTAAGCTCTATTATT

2 rotavirus 1 70 rotavirus_1_543_5:0:0_11:0:0_390/2 + 60
GGCTTTTAATGCTTTTCAGTGGTTGCTGCTCAAGATGGAGTCTACTCAGCAGATGGTAAGCTCTATTATT
GGCTTTTAATGCTTTTCATTTGATGCTGCTCAAGATGGAGTCTACACAGCAGATGGTCAGCTCTATTATT

3 rotavirus 1 70 rotavirus_1_578_3:0:0_7:0:0_7c/1 + 60
GGCTTTTAATGCTTTTCAGTGGTTGCTGCTCAAGATGGAGTCTACTCAGCAGATGGTAAGCTCTATTATT
GGCTTTTAATGCTTTTCAGTGGTTGCTGCTCAAGATGGAGTCTCCTGAGCAGCTGGTAAGCTCTATTATT
(...)

thank you pierre but I can't run this code.

I must install jvarkit?

I installed the tool. but I can't run Biostar70742.java

there are errors.

[m@rainman biostar]$ javac Biostar170742.java

same problem BUILD Failed.

[mk@rainman jvarkit]$ make biostar170742
echo "Compiling htsjdk with ${JAVA_HOME} = "
Compiling htsjdk with  =
echo "Compiling htsjdk library for java. Requires  apache ANT. If it fails here, it's a not a problem with jvarkit."
Compiling htsjdk library for java. Requires  apache ANT. If it fails here, it's a not a problem with jvarkit.
echo "And ${JAVA_HOME}/bin/javac should be >=1.8"
And /bin/javac should be >=1.8
(cd /home/mk/jvarkit/htsjdk-2.0.1 && ant )
Buildfile: build.xml

write-version-property:

BUILD FAILED
/home/mk/jvarkit/htsjdk-2.0.1/build.xml:64: Problem: failed to create task or type propertyfile
Cause: the class org.apache.tools.ant.taskdefs.optional.PropertyFile was not found.
        This looks like one of Ant's optional components.
Action: Check that the appropriate optional JAR exists in
        -/usr/share/ant/lib
        -/home/mk/.ant/lib
        -a directory added on the command line with the -lib argument

Do not panic, this is a common problem.
The commonest cause is a missing JAR.

This is not a bug; it is a configuration problem

Total time: 0 seconds
make: *** [/home/mk/jvarkit/htsjdk-2.0.1/dist/htsjdk-2.0.1.jar] Erreur 1
[mk@rainman jvarkit]$

Log in to answer this question.