Question: How to sort sam file using shell script?
0
Entering edit mode

How can I sort sam files just using shell script, without using samtools? I'd like to sort by the chromosome + position number thx!

ADD COMMENTlink 8 months ago gerrybio2010 • 0 • updated 8 months ago Bastien HervĂ© 4.2k
Entering edit mode
3

you don't and you use samtools.

ADD REPLYlink 8 months ago
Pierre Lindenbaum
120k
Entering edit mode
0
Entering edit mode
0

Why not use samtools? Is this homework?

ADD REPLYlink 8 months ago
Benn
6.9k
Entering edit mode
0

definitely I know it's better to use samtools. but we are running on AWS EC2, and it seems the machine lacks of some library. so we would like to compress just by shell

ADD REPLYlink 8 months ago
gerrybio2010
• 0
Entering edit mode
1

it seems the machine lacks of some library.

so it's a xy problem

ADD REPLYlink 8 months ago
Pierre Lindenbaum
120k
• updated 8 months ago
Benn
6.9k
Entering edit mode
0

and it seems the machine lacks of some library.

If you would be a bit more specific here then maybe we can help.

ADD REPLYlink 8 months ago
WouterDeCoster
39k
Entering edit mode
0

thx a lot. the error is: error while loading shared libraries: libncursesw.so.6: cannot open shared object file: No such file or directory.....i don't know how to figure this out..

ADD REPLYlink 8 months ago
gerrybio2010
• 0
Entering edit mode
0

it's a problem with your environment variable LD_LIBRARY_PATH

find where is the file 'libncursesw.so' and then add the path to its directory to LD_LIBRARY_PATH

ADD REPLYlink 8 months ago
Pierre Lindenbaum
120k
Entering edit mode
0

thx. I tried "export LD_LIBRARY_PATH=/lib64/:$LD_LIBRARY_PATH", but it still not working.....

ADD REPLYlink 8 months ago
gerrybio2010
• 0
Entering edit mode
0
export LD_LIBRARY_PATH=/lib64:${LD_LIBRARY_PATH}

and what is the output of

ls /lib64/libncursesw.*
ADD REPLYlink 8 months ago
Pierre Lindenbaum
120k
Entering edit mode
0

Actually it's libncursesw.so.5 I keep trying lower version of samtools, but it keeps asking for libncursesw.so.6. Why can't even lower version samtools libncursesw.so.5?

ADD REPLYlink 8 months ago
gerrybio2010
• 0
Entering edit mode
0

I tried "export LD_LIBRARY_PATH=/lib64:${LD_LIBRARY_PATH}", still not work, it keeps asking for libncursesw.so.6

ADD REPLYlink 8 months ago
gerrybio2010
• 0
Entering edit mode
0

Depending on your OS:

sudo apt-get install libncurses5-dev libncursesw5-dev

...or:

sudo yum install ncurses-devel
ADD REPLYlink 8 months ago
Kevin Blighe
43k
Entering edit mode
0

did you compile samtools on the AWS side ? if true, there must be this library somewhere. Otherwise, try to recompile a samtools from sources on AWS.

ADD REPLYlink 8 months ago
Pierre Lindenbaum
120k

Login before adding your answer.

Powered by the version 1.8