Hello everyone!
I am getting started with chip-seq analysis so this is probably a very basic question. In the following command:
samtools view -Shu s1.sam > s1.bam
What does -Shu
do/mean?
Thanks a lot!
PS: I couldn't find any reference or explanation anywhere.
There's a lot of times where a specific setting/command is not easy to google, or you may not have access to a search engine at that time. In case you're often in that situation, my tip would be to try these steps in order:
1)
man yourcommand # Opens up the manual/man pages if installed or if they exists
2)
yourcommand --help # See if there's a help menu for the tool
3)
yourcommand -h # Same as above. Can also try --h, -help
4)
yourcommand # Run the command without any arguments, often the fallback is to show the help menu.
In this case,
man samtools
opens up the man pages for samtools (with a section forview
), orsamtools view
without arguments prints out the help menu. If all these fail, look at the tool's official website or its github repository, if they have one.Tools that follow unix philosophy of parameters can have their parameters clustered. For example,
samtools -Shu
is the same assamtools -S -h -u
. This applies to almost all unix commands that don't take an argument after the parameter name. If the parameter takes an argument, it must not be combined with another such parameter and must ideally be placed at the end of the cluster.For example,
tar -c -z -v -f file.tar.gz -T files.list
can also be written astar -czvf file.tar.gz -T files.list
, but not astar -czvfT file.tar.gz files.list
That's what I was missing, didn't know that. Thanks a lot!