Skip to content

Instantly share code, notes, and snippets.

View telatin's full-sized avatar
:octocat:

Andrea Telatin telatin

:octocat:
View GitHub Profile
@telatin
telatin / itunes_rename_with_tags.py
Created December 2, 2020 11:54
Rename Mp3 from iTunes library (F00/FAYX.mp3) to "outputdir/AlbumName/Artist-TrackTitle.mp3"
#!/usr/bin/env python3
"""
Rename Mp3 from iTunes library (F00/FAYX.mp3) to
outputdir/AlbumName/Artist-TrackTitle.mp3
"""
import eyed3
import os, sys, re
@telatin
telatin / qiime_1.pl
Created December 1, 2020 12:38
My first Qiime 1 mini script to perform basic steps
#!/usr/bin/env perl
use 5.012;
use Term::ANSIColor;
# Andrea Telatin <andrea.telatin@bmr-genomics.it>
# Sept 2014
my $version = '0.04';
#!/bin/bash
#wget https://files.plutof.ut.ee/public/orig/98/AE/98AE96C6593FC9C52D1C46B96C2D9064291F4DBA625EF189FEC1CCAFCF4A1691.gz
#Decompress. The downloaded file is actually a tar.gz file and so needs to be decompressed with:
tar xzf 98AE96C6593FC9C52D1C46B96C2D9064291F4DBA625EF189FEC1CCAFCF4A1691.gz
#Move into the developer directory.
cd sh_qiime_release_04.02.2020/developer/
#Fix formatting errors that prevent importation of the reference sequences into QIIME2.
IMG=/path/to/img
singularity exec $IMG $(basename "$0") "$@"
#!/bin/sh
EXT='fastq.gz'
USER=ftp-username
PASS=ftp-password
HOST=ftp.host
REMOTEDIR=uploads/
# see "-z" to try to resume transfers
#ncftpput -u "$USER" -p "$PASS" "$HOST" "$REMOTEDIR" *.$EXT
@telatin
telatin / rename_prokka_contigs.pl
Created October 22, 2020 13:16
If prokka renamed contigs for sumbission ready format, this script can take the original contig names and spit out a GFF using those. BED output also supported.
#!/usr/bin/env perl
use 5.012;
use warnings;
use lib '/qib/platforms/Informatics/GMH/bin/perl5/lib/perl5/';
use Getopt::Long;
use FASTX::Reader;
my $opt_contigs;
my $opt_gff;
library(edgeR)
# Input file and columns (ctrl, treated)
x <- read.delim("counts.tsv",row.names="Geneid")
group <- factor(c(1,1,1,2,2,2))
y <- DGEList(counts=x,group=group)
y <- calcNormFactors(y)
design <- model.matrix(~group)
import heapqueue
type
coverage = ref object
forward: int
reverse: int
# Class that stores info about the end position of alignments, used in the alignment queue
type
import iterutils
iterator letters: char {.closure.} =
for c in 'a' .. 'z':
yield c
# Now requires a parameter
iterator numbers(s: int): int {.closure.}=
var n = s
while true:
#!/usr/bin/env perl
# lisa-andrea, Dec 10 2016
my$f= $[;my
$ch=0;sub l{length}
sub r{join"", reverse split
("",$_[$[])}sub ss{substr($_[0]
,$_[1],$_[2])}sub be{$_=$_[0];p
(ss($_,$f,1));$f+=l()/2;$f%=l
();$f++if$ch%2;$ch++}my$q=r