Skip to content

Commit

Permalink
Deployed e965bbc with MkDocs version: 1.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
davetang committed Mar 25, 2024
1 parent 4288467 commit febf0a6
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 44 deletions.
84 changes: 42 additions & 42 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ <h2 id="basic-usage">Basic usage</h2>
</code></pre>
<pre><code>##
## Program: samtools (Tools for alignments in the SAM format)
## Version: 1.18 (using htslib 1.18)
## Version: 1.19.2 (using htslib 1.19.1)
##
## Usage: samtools &lt;command&gt; [options]
##
Expand Down Expand Up @@ -270,20 +270,20 @@ <h2 id="converting-a-sam-file-to-a-bam-file">Converting a SAM file to a BAM file
<p>Size of SAM file.</p>
<pre><code class="language-bash">ls -lh eg/ERR188273_chrX.sam
</code></pre>
<pre><code>## -rw-r--r-- 1 root root 321M Aug 30 00:57 eg/ERR188273_chrX.sam
<pre><code>## -rw-r--r-- 1 root root 321M Mar 25 06:10 eg/ERR188273_chrX.sam
</code></pre>
<p>Size of BAM file.</p>
<pre><code class="language-bash">ls -lh eg/ERR188273_chrX.bam
</code></pre>
<pre><code>## -rw-r--r-- 1 root root 67M Aug 30 00:55 eg/ERR188273_chrX.bam
<pre><code>## -rw-r--r-- 1 root root 67M Mar 25 06:08 eg/ERR188273_chrX.bam
</code></pre>
<p>We can use <code>head</code> to view a SAM file.</p>
<pre><code class="language-bash">head eg/ERR188273_chrX.sam
</code></pre>
<pre><code>## @HD VN:1.0 SO:coordinate
## @SQ SN:chrX LN:156040895
## @PG ID:hisat2 PN:hisat2 VN:2.2.0 CL:"/Users/dtang/github/rnaseq/hisat2/../src/hisat2-2.2.0/hisat2-align-s --wrapper basic-0 --dta -p 4 -x ../raw/chrX_data/indexes/chrX_tran -1 /tmp/4195.inpipe1 -2 /tmp/4195.inpipe2"
## @PG ID:samtools PN:samtools PP:hisat2 VN:1.18 CL:samtools view -h eg/ERR188273_chrX.bam
## @PG ID:samtools PN:samtools PP:hisat2 VN:1.19.2 CL:samtools view -h eg/ERR188273_chrX.bam
## ERR188273.4711308 73 chrX 21649 0 5S70M = 21649 0 CGGGTGATCACGAGGTCAGGAGATCAAGACCATCCTGGCCAACACAGTGAAACCCCATCTCTACTAAAAATACAA @@@F=DDFFHGHBHIFFHIGGIFGEGHFHIGIGIFIIIGIGIGGDHIIGIIC@&gt;DGHCHHHGHHFFFFFDEACC@ AS:i:-5 ZS:i:-5 XN:i:0 XM:i:0 XO:i:0 XG:i:0 NM:i:0 MD:Z:70 YT:Z:UP NH:i:2
## ERR188273.4711308 133 chrX 21649 0 * = 21649 0 CTACAGGTGCCCGCCACCATGCCCAGCTAATTTTTTTTGTATTTTTAGTAGAGATGGGGTTTCACTGTGTTGGCC CB@FDFFFHHGFHIJJJJIIIIIIIGGGIJGIIJJJJJJFFHIIIIGECHEHHGGHHFF?AACCDDDDDDDDBCD YT:Z:UP
## ERR188273.4711308 329 chrX 233717 0 5S70M = 233717 0 CGGGTGATCACGAGGTCAGGAGATCAAGACCATCCTGGCCAACACAGTGAAACCCCATCTCTACTAAAAATACAA @@@F=DDFFHGHBHIFFHIGGIFGEGHFHIGIGIFIIIGIGIGGDHIIGIIC@&gt;DGHCHHHGHHFFFFFDEACC@ AS:i:-5 ZS:i:-5 XN:i:0 XM:i:0 XO:i:0 XG:i:0 NM:i:0 MD:Z:70 YT:Z:UP NH:i:2
Expand Down Expand Up @@ -312,9 +312,9 @@ <h2 id="converting-a-bam-file-to-a-cram-file">Converting a BAM file to a CRAM fi

ls -lh eg/ERR188273_chrX.[sbcr]*am
</code></pre>
<pre><code>## -rw-r--r-- 1 root root 67M Aug 30 00:55 eg/ERR188273_chrX.bam
## -rw-r--r-- 1 root root 40M Aug 30 00:58 eg/ERR188273_chrX.cram
## -rw-r--r-- 1 root root 321M Aug 30 00:57 eg/ERR188273_chrX.sam
<pre><code>## -rw-r--r-- 1 root root 67M Mar 25 06:08 eg/ERR188273_chrX.bam
## -rw-r--r-- 1 root root 40M Mar 25 06:10 eg/ERR188273_chrX.cram
## -rw-r--r-- 1 root root 321M Mar 25 06:10 eg/ERR188273_chrX.sam
</code></pre>
<p>You can use <code>samtools view</code> to view a CRAM file just as you would for a
BAM file.</p>
Expand Down Expand Up @@ -343,27 +343,27 @@ <h2 id="sorting-a-sambam-file">Sorting a SAM/BAM file</h2>
ls -l eg/ERR188273_chrX.bam
ls -l eg/sorted.bam
</code></pre>
<pre><code>## -rw-r--r-- 1 root root 69983526 Aug 30 00:55 eg/ERR188273_chrX.bam
## -rw-r--r-- 1 root root 69983598 Aug 30 00:58 eg/sorted.bam
<pre><code>## -rw-r--r-- 1 root root 69983526 Mar 25 06:08 eg/ERR188273_chrX.bam
## -rw-r--r-- 1 root root 69983599 Mar 25 06:10 eg/sorted.bam
</code></pre>
<p>You should use use additional threads (if they are available) to speed
up sorting; to use four threads, use <code>-@ 4</code>.</p>
<p>Time taken using one thread (default).</p>
<pre><code class="language-bash">time samtools sort eg/ERR188273_chrX.sam -o eg/sorted.bam
</code></pre>
<pre><code>##
## real 0m8.962s
## user 0m8.636s
## sys 0m0.236s
## real 0m8.762s
## user 0m8.436s
## sys 0m0.268s
</code></pre>
<p>Time taken using four threads.</p>
<pre><code class="language-bash">time samtools sort -@ 4 eg/ERR188273_chrX.sam -o eg/sorted.bam
</code></pre>
<pre><code>## [bam_sort_core] merging from 0 files and 4 in-memory blocks...
##
## real 0m5.108s
## user 0m9.141s
## sys 0m0.426s
## real 0m2.897s
## user 0m10.521s
## sys 0m0.483s
</code></pre>
<p>Many of the SAMtools subtools can use additional threads, so make use of
them if you have the resources!</p>
Expand All @@ -382,7 +382,7 @@ <h2 id="adding-read-groups">Adding read groups</h2>
<pre><code>## @HD VN:1.0 SO:coordinate
## @SQ SN:chrX LN:156040895
## @PG ID:hisat2 PN:hisat2 VN:2.2.0 CL:"/Users/dtang/github/rnaseq/hisat2/../src/hisat2-2.2.0/hisat2-align-s --wrapper basic-0 --dta -p 4 -x ../raw/chrX_data/indexes/chrX_tran -1 /tmp/4195.inpipe1 -2 /tmp/4195.inpipe2"
## @PG ID:samtools PN:samtools PP:hisat2 VN:1.18 CL:samtools addreplacerg -r @RG\tID:ERR188273\tSM:ERR188273\tPL:illumina -o eg/ERR188273_chrX_rg.bam eg/ERR188273_chrX.bam
## @PG ID:samtools PN:samtools PP:hisat2 VN:1.19.2 CL:samtools addreplacerg -r @RG\tID:ERR188273\tSM:ERR188273\tPL:illumina -o eg/ERR188273_chrX_rg.bam eg/ERR188273_chrX.bam
## @RG ID:ERR188273 SM:ERR188273 PL:illumina
</code></pre>
<p>If you want to replace existing read groups, just use the same command.</p>
Expand All @@ -392,8 +392,8 @@ <h2 id="adding-read-groups">Adding read groups</h2>
<pre><code>## @HD VN:1.0 SO:coordinate
## @SQ SN:chrX LN:156040895
## @PG ID:hisat2 PN:hisat2 VN:2.2.0 CL:"/Users/dtang/github/rnaseq/hisat2/../src/hisat2-2.2.0/hisat2-align-s --wrapper basic-0 --dta -p 4 -x ../raw/chrX_data/indexes/chrX_tran -1 /tmp/4195.inpipe1 -2 /tmp/4195.inpipe2"
## @PG ID:samtools PN:samtools PP:hisat2 VN:1.18 CL:samtools addreplacerg -r @RG\tID:ERR188273\tSM:ERR188273\tPL:illumina -o eg/ERR188273_chrX_rg.bam eg/ERR188273_chrX.bam
## @PG ID:samtools.1 PN:samtools PP:samtools VN:1.18 CL:samtools addreplacerg -r @RG\tID:ERR188273_2\tSM:ERR188273_2\tPL:illumina_2 -o eg/ERR188273_chrX_rg2.bam eg/ERR188273_chrX_rg.bam
## @PG ID:samtools PN:samtools PP:hisat2 VN:1.19.2 CL:samtools addreplacerg -r @RG\tID:ERR188273\tSM:ERR188273\tPL:illumina -o eg/ERR188273_chrX_rg.bam eg/ERR188273_chrX.bam
## @PG ID:samtools.1 PN:samtools PP:samtools VN:1.19.2 CL:samtools addreplacerg -r @RG\tID:ERR188273_2\tSM:ERR188273_2\tPL:illumina_2 -o eg/ERR188273_chrX_rg2.bam eg/ERR188273_chrX_rg.bam
## @RG ID:ERR188273_2 SM:ERR188273_2 PL:illumina_2
</code></pre>
<p>Popular alignment tools such as BWA MEM and STAR can add read groups;
Expand Down Expand Up @@ -645,8 +645,8 @@ <h2 id="samtools-calmdfillmd">samtools calmd/fillmd</h2>
<pre><code>## @HD VN:1.0 SO:coordinate
## @SQ SN:chrX LN:156040895
## @PG ID:hisat2 PN:hisat2 VN:2.2.0 CL:"/Users/dtang/github/rnaseq/hisat2/../src/hisat2-2.2.0/hisat2-align-s --wrapper basic-0 --dta -p 4 -x ../raw/chrX_data/indexes/chrX_tran -1 /tmp/4195.inpipe1 -2 /tmp/4195.inpipe2"
## @PG ID:samtools PN:samtools PP:hisat2 VN:1.18 CL:samtools view -b eg/ERR188273_chrX.bam
## @PG ID:samtools.1 PN:samtools PP:samtools VN:1.18 CL:samtools fillmd -e - genome/chrX.fa
## @PG ID:samtools PN:samtools PP:hisat2 VN:1.19.2 CL:samtools view -b eg/ERR188273_chrX.bam
## @PG ID:samtools.1 PN:samtools PP:samtools VN:1.19.2 CL:samtools fillmd -e - genome/chrX.fa
## ERR188273.4711308 73 chrX 21649 0 5S70M = 21649 0 CGGGT====================================================================== @@@F=DDFFHGHBHIFFHIGGIFGEGHFHIGIGIFIIIGIGIGGDHIIGIIC@&gt;DGHCHHHGHHFFFFFDEACC@ AS:i:-5 ZS:i:-5 XN:i:0 XM:i:0 XO:i:0 XG:i:0 NM:i:0 MD:Z:70 YT:Z:UP NH:i:2
## ERR188273.4711308 133 chrX 21649 0 * = 21649 0 CTACAGGTGCCCGCCACCATGCCCAGCTAATTTTTTTTGTATTTTTAGTAGAGATGGGGTTTCACTGTGTTGGCC CB@FDFFFHHGFHIJJJJIIIIIIIGGGIJGIIJJJJJJFFHIIIIGECHEHHGGHHFF?AACCDDDDDDDDBCD YT:Z:UP
## ERR188273.4711308 329 chrX 233717 0 5S70M = 233717 0 CGGGT====================================================================== @@@F=DDFFHGHBHIFFHIGGIFGEGHFHIGIGIFIIIGIGIGGDHIIGIIC@&gt;DGHCHHHGHHFFFFFDEACC@ AS:i:-5 ZS:i:-5 XN:i:0 XM:i:0 XO:i:0 XG:i:0 NM:i:0 MD:Z:70 YT:Z:UP NH:i:2
Expand Down Expand Up @@ -736,26 +736,26 @@ <h2 id="comparing-bam-files">Comparing BAM files</h2>
<pre><code class="language-bash">samtools mpileup -s -f test_ref.fa aln_bwa.bam aln_mm.bam | head -20
</code></pre>
<pre><code>## [mpileup] 2 samples in 2 input files
## 1 350 G 1 ^]. ? ] 1 ^]. ? ]
## 1 351 G 1 . A ] 1 . A ]
## 1 352 G 1 . B ] 1 . B ]
## 1 353 G 1 . E ] 1 . E ]
## 1 354 A 1 . J ] 1 . J ]
## 1 355 C 1 . J ] 1 . J ]
## 1 356 C 1 . J ] 1 . J ]
## 1 357 G 1 . J ] 1 . J ]
## 1 358 T 1 . J ] 1 . J ]
## 1 359 G 1 . J ] 1 . J ]
## 1 360 C 1 . J ] 1 . J ]
## 1 361 T 1 . J ] 1 . J ]
## 1 362 T 1 . J ] 1 . J ]
## 1 363 C 1 . J ] 1 . J ]
## 1 364 T 1 . J ] 1 . J ]
## 1 365 T 1 . J ] 1 . J ]
## 1 366 A 1 . J ] 1 . J ]
## 1 367 G 1 . J ] 1 . J ]
## 1 368 G 1 . J ] 1 . J ]
## 1 369 G 1 . J ] 1 . J ]
## 1 1694 C 1 ^]. D ] 1 ^]. D ]
## 1 1695 G 1 . I ] 1 . I ]
## 1 1696 T 1 . J ] 1 . J ]
## 1 1697 T 1 . J ] 1 . J ]
## 1 1698 A 1 . J ] 1 . J ]
## 1 1699 A 1 . J ] 1 . J ]
## 1 1700 T 1 . J ] 1 . J ]
## 1 1701 C 1 . J ] 1 . J ]
## 1 1702 A 1 . J ] 1 . J ]
## 1 1703 A 1 . J ] 1 . J ]
## 1 1704 T 1 . J ] 1 . J ]
## 1 1705 C 1 . J ] 1 . J ]
## 1 1706 C 1 . J ] 1 . J ]
## 1 1707 C 1 . J ] 1 . J ]
## 1 1708 C 1 . J ] 1 . J ]
## 1 1709 C 1 . J ] 1 . J ]
## 1 1710 A 1 . J ] 1 . J ]
## 1 1711 A 1 . J ] 1 . J ]
## 1 1712 C 1 . J ] 1 . J ]
## 1 1713 A 1 . J ] 1 . J ]
</code></pre>
<p>Another approach is to use
<a href="https://deeptools.readthedocs.io/en/develop/">deepTools</a> and the
Expand Down Expand Up @@ -785,7 +785,7 @@ <h2 id="converting-reference-names">Converting reference names</h2>
<pre><code>## @HD VN:1.0 SO:coordinate
## @SQ SN:chrX LN:156040895
## @PG ID:hisat2 PN:hisat2 VN:2.2.0 CL:"/Users/dtang/github/rnaseq/hisat2/../src/hisat2-2.2.0/hisat2-align-s --wrapper basic-0 --dta -p 4 -x ../raw/chrX_data/indexes/chrX_tran -1 /tmp/4195.inpipe1 -2 /tmp/4195.inpipe2"
## @PG ID:samtools PN:samtools PP:hisat2 VN:1.18 CL:samtools view -H eg/ERR188273_chrX.bam
## @PG ID:samtools PN:samtools PP:hisat2 VN:1.19.2 CL:samtools view -H eg/ERR188273_chrX.bam
</code></pre>
<p>Substitute header with new name.</p>
<pre><code class="language-bash">samtools view -H eg/ERR188273_chrX.bam | sed 's/SN:chrX/SN:X/' &gt; eg/my_header
Expand Down Expand Up @@ -956,5 +956,5 @@ <h2 id="stargazers-over-time">Stargazers over time</h2>

<!--
MkDocs version : 1.3.0
Build Date UTC : 2023-08-30 01:01:27.862070+00:00
Build Date UTC : 2024-03-25 06:13:19.989786+00:00
-->
2 changes: 1 addition & 1 deletion search/search_index.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion sitemap.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
<url>
<loc>None</loc>
<lastmod>2023-08-30</lastmod>
<lastmod>2024-03-25</lastmod>
<changefreq>daily</changefreq>
</url>
</urlset>
Binary file modified sitemap.xml.gz
Binary file not shown.

0 comments on commit febf0a6

Please sign in to comment.