Skip to content

Instantly share code, notes, and snippets.

View freenas_11.2_update_fix_vnets
/bin/sh -c 'export JAILS="$(iocage list -h | cut -f 2)"; for jail in $JAILS; do iocage set vnet_default_interface=auto $jail; done; iocage set vnet_default_intercace=auto default'
View scanpy_137_packages.txt
Package Version
------------------------ -----------
alabaster 0.7.12
anndata 0.6.18
astropy 3.1.1
atomicwrites 1.3.0
attrs 18.2.0
Babel 2.6.0
backcall 0.1.0
certifi 2018.11.29
View TCGAanalyze_RemoveReplicateSamples.R
# http://gdac.broadinstitute.org/runs/sampleReports/latest/READ_Replicate_Samples.html
TCGAanalyze_RemoveReplicateSamples<-function(tabDF, typesample){
tabDF.typesample <- tabDF[, TCGAquery_SampleTypes(colnames(tabDF), typesample=typesample)]
# detect duplicated patient for typesample
tabDF.typesample.duplicated = duplicated(tabDF.typesample$patient)
if (sum(tabDF.typesample.duplicated)>0){
tabDF.typesample.not_duplicated = !(tabDF.typesample$patient %in% tabDF.typesample[,tabDF.typesample.duplicated]$patient)
# print(tabDF.typesample$patient[tabDF.typesample.duplicated])
# print(class(tabDF.typesample$patient[tabDF.typesample.duplicated]))
barcodes_solved_duplication=sapply(tabDF.typesample$patient[tabDF.typesample.duplicated],function(patient, dataset){
@helios
helios / rstudio.scm
Created Oct 17, 2016
guix and rstudio
View rstudio.scm
;;; GNU Guix --- Functional package management for GNU
;;; Copyright © 2015, 2016 Ricardo Wurmus <rekado@elephly.net>
;;; Copyright © 2015 Vicente Vera Parra <vicentemvp@gmail.com>
;;; Copyright © 2016 Andreas Enge <andreas@enge.fr>
;;; Copyright © 2016 Efraim Flashner <efraim@flashner.co.il>
;;; Copyright © 2016 Pjotr Prins <pjotr.guix@thebird.nl>
;;; Copyright © 2016 Roel Janssen <roel@gnu.org>
;;; Copyright © 2016 Ben Woodcroft <donttrustben@gmail.com>
;;;
;;; This file is part of GNU Guix.
@helios
helios / gist:1169793
Created Aug 25, 2011
Solve OSX heat problem prl_disp_service
View gist:1169793
sudo launchctl stop com.parallels.desktop.launchdaemon
sudo launchctl start com.parallels.desktop.launchdaemon
@helios
helios / gist:fdc94a2637a208d47a03
Created Jan 13, 2016
Scala Create an iterator using a Stream over 2 "aligned" files
View gist:fdc94a2637a208d47a03
test("Detect barcodes in forward and reverse reads in Fastq format") {
val readerR1 = new FastqReader(new java.io.File(getClass.getResource("/R1.fastq.gz").getPath))
val readerR2 = new FastqReader(new java.io.File(getClass.getResource("/R2.fastq.gz").getPath))
var list = List[String]()
case class Reads( r1: FastqRecord, r2: FastqRecord)
val stream: Stream[Reads]= {
def reads(readerR1: FastqReader, readerR2: FastqReader): Stream[Reads] = {
readerR1.hasNext() && readerR2.hasNext() match {
@helios
helios / gist:2924846
Created Jun 13, 2012
Quick and dirty deployment of your Ruby Gem to your server(s)
View gist:2924846
# You must be the owner of the destination directory
rsync -avz --exclude-from=.gitignore --exclude '.git' -e ssh ./ bioinfoadm@starscream.ingm.ad:/usr/local/lib/ruby/gems/1.9.1/gems/yourgem
@helios
helios / MultiMemberGZIPInputStream.java
Created Jun 11, 2012
MultiMemberGZIPInputStream Concatenate multiple gzip in java
View MultiMemberGZIPInputStream.java
// reference http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4691425
// author: I'm not, I could not find he/she but the rights belong to it.
package x.y.z;
import java.io.InputStream;
import java.io.PushbackInputStream;
import java.io.IOException;
public
@helios
helios / gist:2658172
Created May 11, 2012
Parsing Cufflinks Gtf file/data, in an ActiveRecord style
View gist:2658172
g=Bio::Ngs::Cufflinks::Gtf.new "./spec/fixture/transcripts.gtf"
g.set_lazy
a=g.multi_exon.coverage_gt(3).length_gt(200)
#not yet parsed until you iterate of the transcripts
a.multi_exons.each_transcript {|t| puts t; break}
#accessing to an exon using the indexin:
g.read_transcript(10) #return a string of the block
g.get_tranascript(10) #return an object transcript.
@helios
helios / gist:1315778
Created Oct 26, 2011
CuffDiff output iterator, preliminar example
View gist:1315778
#CLASS DEFINITION Bio::Ngs::Cufflinks
class Diff
include Bio::Command::Wrapper
include Bio::Ngs::Cufflinks::Diff::Utils
set_program Bio::Ngs::Utils.binary("cuffdiff")
add_option "output-dir", :type => :string, :aliases => '-o', :default => "./"
add_option "time-series", :type => :boolean, :aliases => '-T'
add_option "min-alignment-count", :type => :numeric, :aliases => '-c'