<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Recent changes to Snippets</title><link>https://sourceforge.net/p/gemma-omics-integrate/wiki/Snippets/</link><description>Recent changes to Snippets</description><atom:link href="https://sourceforge.net/p/gemma-omics-integrate/wiki/Snippets/feed" rel="self"/><language>en</language><lastBuildDate>Fri, 24 Apr 2020 13:10:07 -0000</lastBuildDate><atom:link href="https://sourceforge.net/p/gemma-omics-integrate/wiki/Snippets/feed" rel="self" type="application/rss+xml"/><item><title>Snippets modified by jakelin</title><link>https://sourceforge.net/p/gemma-omics-integrate/wiki/Snippets/</link><description>&lt;div class="markdown_content"&gt;&lt;p&gt;Import files&lt;br/&gt;
cy3_files_ls = list.files(pattern="&lt;em&gt;.txt")&lt;br/&gt;
cy3_files_df &amp;lt;- lapply(cy3_files_ls, function(x) {read.table(file = x, header = T, sep =",")})&lt;br/&gt;
cy3_df &amp;lt;- do.call("rbind", lapply(cy3_files_df, as.data.frame))&lt;br/&gt;
cy3_PM &amp;lt;- lapply(cy3_df, &lt;code&gt;[[&lt;/code&gt;, 1), 5)&lt;br/&gt;
cy5_files_ls = list.files(pattern="&lt;/em&gt;.txt")&lt;br/&gt;
cy5_files_df &amp;lt;- lapply(cy5_files_ls, function(x) {read.table(file = x, header = T, sep =",")})&lt;br/&gt;
cy5_df &amp;lt;- do.call("rbind", lapply(cy5_files_df, as.data.frame))&lt;br/&gt;
cy5_PM &amp;lt;- lapply(cy5_df, &lt;code&gt;[[&lt;/code&gt;, 1), 5)&lt;/p&gt;
&lt;p&gt;Background correction – Limma&lt;br/&gt;
rowname=as.character(info$PROBE_ID)&lt;br/&gt;
xy=as.data.frame(cbind(as.numeric(substr(info$IMAGE_ID,1,8)), as.numeric(info$X), as.numeric(info$Y)))&lt;br/&gt;
colnames(xy)=c("Block", "Row","Column")&lt;br/&gt;
rownames(xy)=rowname&lt;br/&gt;
layout=getLayout(xy)&lt;br/&gt;
RG=new("RGList")&lt;br/&gt;
RG$R=cy3_PM&lt;span&gt;[rowname,]&lt;/span&gt;&lt;br/&gt;
RG$G=cy5_PM&lt;span&gt;[rowname,]&lt;/span&gt;&lt;br/&gt;
RG$genes=info&lt;br/&gt;
RG$printer=layout&lt;br/&gt;
MA=normalizeWithinArrays(RG,method="loess")&lt;/p&gt;
&lt;p&gt;GC-correction – ArrayTV&lt;br/&gt;
increms=c(60,100,1000)&lt;br/&gt;
wins=c(60,100,1000)&lt;br/&gt;
samp=c(1,10,20,30,40,50,60,70,80,90)&lt;br/&gt;
gc_list=gcCorrectMain(Ms=MA&lt;span&gt;[,samp]&lt;/span&gt;, chr=chr, start=start, samplechr=unique(feat$chr), increms=increms, maxwins=wins, build="hg36")&lt;br/&gt;
optimalWin=gc_list[["optimalWin"]]&lt;br/&gt;
gc_content=ArrayTV:::computeGC(x=feat$POSITION, chr=feat$SEQ_ID, maxwins=optimalWin, increms=optimalWin, build="hg38")&lt;br/&gt;
gc_corr=gcCorrect(object=MA, chr=feat$SEQ_ID, start=feat$POSITION, increms=optimalWin, maxwins=optimalWin, build="hg38")&lt;/p&gt;
&lt;p&gt;Segmentation - DNAcopy &lt;br/&gt;
cna=CNA(genomdat=gc_corr[["correctedVals"]],, chrom=feat$SEQ_ID, maploc=MA$genes$POSITIONscreen, data.type="logratio",sampleid=colnames(MA$M),presorted=FALSE)&lt;br/&gt;
cna=smooth.CNA(cna, smooth.region=10, outlier.SD.scale=4, smooth.SD.scale=2, trim=0.025)&lt;br/&gt;
cna=segment(cna, undo.splits="sdundo",undo.SD=3)&lt;br/&gt;
write.table(cna$output, file="cna_output.txt",sep="\t", row.names=F, col.names=T)&lt;/p&gt;
&lt;p&gt;Copy Number Calling - CNVkit&lt;/p&gt;
&lt;h1 id="make-cns-files-from-the-dnacopy-segmentation-output"&gt;make .cns files from the dnacopy segmentation output&lt;/h1&gt;
&lt;p&gt;singularity exec /data/containers/cnvkit_latest.sif cnvkit.py import-seg cna_output.txt&lt;/p&gt;
&lt;p&gt;for file in /data/projects/salenius/GSE23682/keep/cnvkit/*.cns&lt;br/&gt;
do&lt;br/&gt;
singularity exec /data/containers/cnvkit_latest.sif cnvkit.py call "$file" -x y -m clonal -o "$file"&lt;br/&gt;
done&lt;/p&gt;
&lt;h1 id="heatmaps"&gt;heatmaps&lt;/h1&gt;
&lt;p&gt;singularity exec /data/containers/cnvkit_latest.sif cnvkit.py heatmap &lt;em&gt;p1.cns -x y --no-shift-xy -o "asd_hm_no_filt.png"&lt;br/&gt;
singularity exec /data/containers/cnvkit_latest.sif cnvkit.py heatmap &lt;/em&gt;s1.cns -x y --no-shift-xy -o "ctrl_hm_no_filt.png"&lt;/p&gt;
&lt;p&gt;singularity exec /data/containers/cnvkit_latest.sif cnvkit.py scatter -s X11004.s1.cns -c chr9 -o "scatter.png"&lt;br/&gt;
singularity exec /data/containers/cnvkit_latest.sif cnvkit.py scatter -s X11004.s1.cns -c chr1 -o "chr1.png"&lt;/p&gt;
&lt;p&gt;for file in /data/projects/salenius/GSE23682/keep/cnvkit/*.cns&lt;br/&gt;
do&lt;br/&gt;
singularity exec /data/containers/cnvkit_latest.sif cnvkit.py export vcf "$file" -y -g male -o "$file".vcf&lt;br/&gt;
done&lt;/p&gt;&lt;/div&gt;</description><dc:creator xmlns:dc="http://purl.org/dc/elements/1.1/">jakelin</dc:creator><pubDate>Fri, 24 Apr 2020 13:10:07 -0000</pubDate><guid>https://sourceforge.netf8154eae0b1d6259aa35a5adff60a21d696b8dc8</guid></item></channel></rss>