<?xml version='1.0'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:georss="http://www.georss.org/georss" xmlns:atom="http://www.w3.org/2005/Atom" >
<channel>
	<title><![CDATA[BOL: Owner]]></title>
	<link>https://bioinformaticsonline.com/snippets/owner/neelam?offset=30</link>
	<atom:link href="https://bioinformaticsonline.com/snippets/owner/neelam?offset=30" rel="self" type="application/rss+xml" />
	<description><![CDATA[]]></description>
	
	<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/snippets/view/41596/install-ragout-genome-assembler</guid>
	<pubDate>Sat, 02 May 2020 06:46:00 -0500</pubDate>
	<link>https://bioinformaticsonline.com/snippets/view/41596/install-ragout-genome-assembler</link>
	<title><![CDATA[Install Ragout genome assembler]]></title>
	<description><![CDATA[<code>$ conda install -c bioconda ragout
Collecting package metadata (repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /home/anaconda3

  added / updated specs:
    - ragout


The following packages will be downloaded:

    package                    |            build
    ---------------------------|-----------------
    decorator-4.3.0            |           py37_0          15 KB
    ragout-2.3                 |   py37hc9558a2_0         2.8 MB  bioconda
    sibelia-3.0.7              |       he1b5a44_2        24.8 MB  bioconda
    ------------------------------------------------------------
                                           Total:        27.6 MB

The following NEW packages will be INSTALLED:

  ragout             bioconda/linux-64::ragout-2.3-py37hc9558a2_0
  sibelia            bioconda/linux-64::sibelia-3.0.7-he1b5a44_2

The following packages will be DOWNGRADED:

  decorator                                    4.4.0-py37_1 --&gt; 4.3.0-py37_0


Proceed ([y]/n)? y


Downloading and Extracting Packages
ragout-2.3           | 2.8 MB    | ################################################## | 100% 
sibelia-3.0.7        | 24.8 MB   | ################################################## | 100% 
decorator-4.3.0      | 15 KB     | ################################################## | 100% 
Preparing transaction: done
Verifying transaction: done
Executing transaction: done</code>]]></description>
	<dc:creator>Neel</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/snippets/view/40756/install-samtools-bcftools-and-htslib-on-ubuntu</guid>
	<pubDate>Wed, 29 Jan 2020 06:47:15 -0600</pubDate>
	<link>https://bioinformaticsonline.com/snippets/view/40756/install-samtools-bcftools-and-htslib-on-ubuntu</link>
	<title><![CDATA[Install Samtools, Bcftools and htslib on Ubuntu !]]></title>
	<description><![CDATA[<code>#Inspired from online search
sudo apt-get update
sudo apt-get install gcc
sudo apt-get install make
sudo apt-get install libbz2-dev
sudo apt-get install zlib1g-dev
sudo apt-get install libncurses5-dev 
sudo apt-get install libncursesw5-dev
sudo apt-get install liblzma-dev

cd /usr/bin
wget https://github.com/samtools/htslib/releases/download/1.9/htslib-1.9.tar.bz2
tar -vxjf htslib-1.9.tar.bz2
cd htslib-1.9
make

cd ..
wget https://github.com/samtools/samtools/releases/download/1.9/samtools-1.9.tar.bz2
tar -vxjf samtools-1.9.tar.bz2
cd samtools-1.9
make

cd ..
wget https://github.com/samtools/bcftools/releases/download/1.9/bcftools-1.9.tar.bz2
tar -vxjf bcftools-1.9.tar.bz2
cd bcftools-1.9
make

export PATH=&quot;$PATH:/usr/bin/bcftools-1.9&quot;
export PATH=&quot;$PATH:/usr/bin/samtools-1.9&quot;
export PATH=&quot;$PATH:/usr/bin/htslib-1.9&quot;
source ~/.profile

echo &quot;All done&quot;</code>]]></description>
	<dc:creator>Neel</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/snippets/view/40719/bash-script-to-alignment-of-short-reads-against-reference-genome</guid>
	<pubDate>Tue, 28 Jan 2020 04:21:43 -0600</pubDate>
	<link>https://bioinformaticsonline.com/snippets/view/40719/bash-script-to-alignment-of-short-reads-against-reference-genome</link>
	<title><![CDATA[Bash script to alignment of short reads against reference genome !]]></title>
	<description><![CDATA[<code>bwa mem -t 40 -R &#039;@RG\tID:K12\tSM:K12&#039; \
    E.coli_K12_MG1655.fa SRR1770413_1.fastq.gz SRR1770413_2.fastq.gz \
    | samtools view -b - &gt;SRR1770413.raw.bam
sambamba sort SRR1770413.raw.bam
sambamba markdup SRR1770413.raw.sorted.bam SRR1770413.bam


##Breaking it down by line:

#alignment with bwa: bwa mem -t $threads -R &#039;@RG\tID:K12\tSM:K12&#039; --- this says &quot;align using so many threads&quot; and also &quot;give the reads the read group K12 and the sample name K12&quot;
#reference and FASTQs E.coli_K12_MG1655.fa SRR1770413_1.fastq.gz SRR1770413_2.fastq.gz --- this just specifies the base reference file name (bwa finds the indexes using this) and the input alignment files. The first file should contain the first mate, the second file the second mate.
#conversion to BAM: samtools view -b - --- this reads SAM from stdin (the - specifier in place of the file name indicates this) and converts to BAM.
#sorting the BAM file: sambamba sort SRR1770413.raw.bam --- sort the BAM file, writing it to .sorted.bam.
#marking PCR duplicates: sambamba markdup SRR1770413.raw.sorted.bam SRR1770413.bam --- this marks reads which appear to be redundant PCR duplicates based on their read mapping position. It uses the same criteria for marking duplicates as picard.

minimap2 -ax sr -t 40 -R &#039;@RG\tID:O104_H4\tSM:O104_H4&#039; \
    E.coli_K12_MG1655.fa SRR341549_1.fastq.gz  SRR341549_2.fastq.gz \
    | samtools view -b - &gt;SRR341549.raw.minimap2.bam
sambamba sort SRR341549.raw.minimap2.bam
sambamba markdup SRR341549.raw.sorted.minimap2.bam SRR341549.minimap2.bam

#The only major change from bwa mem is that we&#039;ll tell it we&#039;re working with short read data using -ax sr:</code>]]></description>
	<dc:creator>Neel</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/snippets/view/38171/collectgcbiasmetricsjar-will-generate-a-gc-bias-plot-for-each-contig</guid>
	<pubDate>Fri, 09 Nov 2018 13:37:28 -0600</pubDate>
	<link>https://bioinformaticsonline.com/snippets/view/38171/collectgcbiasmetricsjar-will-generate-a-gc-bias-plot-for-each-contig</link>
	<title><![CDATA[CollectGcBiasMetrics.jar will generate a GC bias plot for each contig]]></title>
	<description><![CDATA[<code>samtools index aln-pe.mapped.sorted.bam

for i in $(samtools view -H aln-pe.mapped.sorted.bam | awk -F&quot;\t&quot; &#039;/@SQ/{gsub(&quot;^SN:&quot;,&quot;&quot;,$2);print $2}&#039;
); do samtools view -b aln-pe.mapped.sorted.bam $i &gt; aln-pe.mapped.sorted.$i.bam; java -Xmx2g -jar $(which CollectGcBiasMetrics.jar) R=data/Cdiff078.fa I=aln-pe.mapped.sorted.$i.bam O=aln-pe.mapped.sorted.${i}_GCBias.txt CHART=aln-pe.mapped.sorted.${i}_GCBias.pdf ASSUME_SORTED=true; done</code>]]></description>
	<dc:creator>Neel</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/snippets/view/38165/script-to-plot-the-coverage</guid>
	<pubDate>Fri, 09 Nov 2018 12:29:07 -0600</pubDate>
	<link>https://bioinformaticsonline.com/snippets/view/38165/script-to-plot-the-coverage</link>
	<title><![CDATA[Script to Plot the Coverage]]></title>
	<description><![CDATA[<code>#!/bin/bash
Plot the coverage script

chr=$1
start=$2
end=$3

samtools depth deduped_MA605.bam &gt; deduped_MA605.coverage

awk &#039;$1 == $chr {print $0}&#039; deduped_MA605.coverage &gt; chr1_MA605.coverage

#awk &#039;$1 == 2 {print $0}&#039; deduped_MA605.coverage &gt; chr2_MA605.coverage

#Rscript
library(reshape)
my.chr2 &lt;- read.table(&quot;my.coverage&quot;, header=FALSE, sep=&quot;\t&quot;, na.strings=&quot;NA&quot;, dec=&quot;.&quot;, strip.white=TRUE)`
my.chr2&lt;-rename(my.chr2,c(V1=&quot;Chr&quot;, V2=&quot;locus&quot;, V3=&quot;depth&quot;)) # renames the header

plot(my.chr2$locus, my.chr2$depth)

#Shushi tool .... gawk &#039;{/^[0-9]/{print &gt;$1&quot;.coverag&quot;}&#039; ./deduped_MA605.coverag</code>]]></description>
	<dc:creator>Neel</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/snippets/view/38164/collecting-arguments-with-r</guid>
	<pubDate>Fri, 09 Nov 2018 12:21:40 -0600</pubDate>
	<link>https://bioinformaticsonline.com/snippets/view/38164/collecting-arguments-with-r</link>
	<title><![CDATA[Collecting arguments with R]]></title>
	<description><![CDATA[<code>#! /usr/bin/Rscript

## Collect arguments
args &lt;- commandArgs(TRUE)

## Parse arguments (we expect the form --arg=value)
parseArgs &lt;- function(x) strsplit(sub(&quot;^--&quot;, &quot;&quot;, x), &quot;=&quot;)
argsL &lt;- as.list(as.character(as.data.frame(do.call(&quot;rbind&quot;, parseArgs(args)))$V2))
names(argsL) &lt;- as.data.frame(do.call(&quot;rbind&quot;, parseArgs(args)))$V1
args &lt;- argsL
rm(argsL)

## Give some value to options if not provided 
if(is.null(args$opt_arg1)) {args$opt_arg1=&quot;default_option1&quot;}
if(is.null(args$opt_arg2)) {args$opt_arg2=&quot;default_option1&quot;} else {args$opt_arg2=as.numeric(args$opt_arg2)}

## Default setting when no all arguments passed or help needed
if(&quot;--help&quot; %in% args | is.null(args$arg1) | is.null(args$arg2)) {
  cat(&quot;
      The R Script arguments_section.R
      
      Mandatory arguments:
      --arg1=type           - description
      --arg2=type           - description
      --help                - print this text
      
      Optionnal arguments:
      --opt_arg1=String          - example:an absolute path, default:default_option1
      --opt_arg2=Value           - example:a threshold, default:10

      WARNING : here put all the things the user has to know
      
      Example:
      ./arguments_section.R --arg1=~/Documents/ --arg2=10 --opt_arg2=8 \n\n&quot;)
  
  q(save=&quot;no&quot;)
}

cat(&quot;first mandatory argument : &quot;, args$arg1,&quot;\n&quot;,sep=&quot;&quot;)
cat(&quot;second mandatory argument : &quot;, args$arg2,&quot;\n&quot;,sep=&quot;&quot;)
cat(&quot;first optional argument : &quot;, args$opt_arg1,&quot;\n&quot;,sep=&quot;&quot;)
cat(&quot;second optional argument : &quot;, args$opt_arg2,&quot;\n&quot;,sep=&quot;&quot;)</code>]]></description>
	<dc:creator>Neel</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/snippets/view/37924/perl-script-to-create-a-consensus-of-nucleotide-sequences</guid>
	<pubDate>Fri, 12 Oct 2018 10:01:22 -0500</pubDate>
	<link>https://bioinformaticsonline.com/snippets/view/37924/perl-script-to-create-a-consensus-of-nucleotide-sequences</link>
	<title><![CDATA[Perl script to create a consensus of nucleotide sequences !]]></title>
	<description><![CDATA[<code>use strict;
use warnings;

my @instances  = qw ( AAAAA ATCGA ATAAA );
my @instances2 = qw ( AAAAA AACGA ATAAA AGAAA AGAAA);

print consensus(@instances),&quot;\n&quot;;        # ATAAA
print consensus(@instances2),&quot;\n&quot;;       # ATAAA
exit;

sub consensus{
 my @mi = @_;
 chomp(@mi);
 my $motif_count=0;
 my @words =();

  my %H = ( A=&gt;[], T=&gt;[], C=&gt;[], G=&gt;[] );

  s/\s//g for @mi;
  my ($w) = sort {$b &lt;=&gt; $a} map {length} @mi;    # set w to the length of the longest element

    foreach my $j ( 0 .. $w-1 ){
        # Initialize the base counts.
        my %h = ( a=&gt;0, t=&gt;0, c=&gt;0, g=&gt;0 );
        my @mi_letters = map { [split &#039;&#039;, uc $_] } @mi;
  	foreach my $j ( 0 .. $w-1 ){
    		$H{ $_-&gt;[$j] }-&gt;[$j]++ for @mi_letters;
  	}
        push @{$H{ uc $_ }}, $h{$_} for keys %h;   # example:  push @{$H{G}}, $g;
    }

    my @cons = ();
    my %prefOrder = ( A=&gt;1, T=&gt;2, C=&gt;3, G=&gt;4 );
    foreach my $B ( 0 .. $w-1 ){
      push @cons, [ sort { ($H{$b}-&gt;[$B]||0) &lt;=&gt; ($H{$a}-&gt;[$B]||0) || $prefOrder{$b} &lt;=&gt; $prefOrder{$a} } qw/A T G C/ ]-&gt;[0];
    }

    return @cons;
}

#reference https://www.perlmonks.org/bare/?node_id=500962</code>]]></description>
	<dc:creator>Neel</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/snippets/view/37802/perl-script-to-reverse-complement-a-dna-sequence</guid>
	<pubDate>Mon, 01 Oct 2018 08:44:56 -0500</pubDate>
	<link>https://bioinformaticsonline.com/snippets/view/37802/perl-script-to-reverse-complement-a-dna-sequence</link>
	<title><![CDATA[Perl script to reverse complement a DNA sequence !]]></title>
	<description><![CDATA[<code>#!/usr/bin/perl -w

$DNA = &#039;ACGGGAGGACGGGAAAATTACTACGGCATTAGC&#039;;

print &quot;Here is the starting DNA:\n\n&quot;;

print &quot;$DNA\n\n&quot;;

$revcom = reverse $DNA;

$revcom =~ s/A/T/g;
$revcom =~ s/T/A/g;
$revcom =~ s/G/C/g;
$revcom =~ s/C/G/g;

print &quot;Here is the reverse complement DNA: WRONG:\n\n&quot;;

print &quot;$revcom\n&quot;;
print &quot;\nThat was a bad algorithm, and the reverse complement was wrong!\n&quot;;
print &quot;Try again ... \n\n&quot;;

# Make a new copy of the DNA (see why we saved the original?)
$revcom = reverse $DNA;

# See the text for a discussion of tr///
$revcom =~ tr/ACGTacgt/TGCAtgca/;

print &quot;Here is the reverse complement DNA:\n\n&quot;;

print &quot;$revcom\n&quot;;

print &quot;\nThis time it worked!\n\n&quot;;

exit;</code>]]></description>
	<dc:creator>Neel</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/snippets/view/36256/coverage-depth-of-reads</guid>
	<pubDate>Tue, 17 Apr 2018 14:18:44 -0500</pubDate>
	<link>https://bioinformaticsonline.com/snippets/view/36256/coverage-depth-of-reads</link>
	<title><![CDATA[Coverage / Depth of reads !]]></title>
	<description><![CDATA[<code># get total number of bases covered at MIN_COVERAGE_DEPTH or higher
samtools mpileup mapping_result_sorted.bam | awk -v X=&quot;${MIN_COVERAGE_DEPTH}&quot; &#039;$4&gt;=X&#039; | wc -l
32876

# get length of reference genome
bowtie2-inspect -s refgenome | awk &#039;{ FS = &quot;\t&quot; } ; BEGIN{L=0}; {L=L+$3}; END{print L}&#039;
45678</code>]]></description>
	<dc:creator>Neel</dc:creator>
</item>
<item>
	<guid isPermaLink="true">https://bioinformaticsonline.com/snippets/view/36254/genome-covered</guid>
	<pubDate>Tue, 17 Apr 2018 14:13:05 -0500</pubDate>
	<link>https://bioinformaticsonline.com/snippets/view/36254/genome-covered</link>
	<title><![CDATA[Genome Covered !]]></title>
	<description><![CDATA[<code>zero=$(bedtools genomecov -ibam BAM -g hg38.fasta -bga | awk &#039;$4==0 {bpCountZero+=($3-$2)} {print bpCountZero}&#039; | tail -1)

nonzero=$(bedtools genomecov -ibam BAM -g hg38.fasta -bga | awk &#039;$4&gt;0 {bpCountNonZero+=($3-$2)} {print bpCountNonZero}&#039; | tail -1)

percent=$(bc &lt;&lt;&lt; &quot;scale=6; ($nonzero / ($zero + $nonzero))*100&quot;)

echo $percent</code>]]></description>
	<dc:creator>Neel</dc:creator>
</item>

</channel>
</rss>