Skip to content

Instantly share code, notes, and snippets.

View telatin's full-sized avatar

Andrea Telatin telatin

View GitHub Profile
telatin / format-thousand-separator.nim
Last active June 7, 2022 07:52
Procedure to add a thousands separator to a float [nim]
import strutils
proc floatSeparator(f: float, s=","): string =
var s = ($f).split('.')
s[0] = s[0].insertSep(',')
return s.join(".")
telatin /
Created June 25, 2021 15:20
Remove primers from paired end reads using Cutadapt and SeqFu
set -euo pipefail
# Cutadapt options
EXTRA=" --report minimal --cores 0 --discard-untrimmed "
telatin /
Created June 22, 2021 10:10
Bash function to print a string to STDERR
#Function to print to STDERR
echoerr() { echo "$@" 1>&2; }
#!/usr/bin/env python3
# Parses a file with a list of URLs (GTR user) and prints
# a table with their projects details
import json
import sys
import traceback
import urllib3
import xmltodict
from pprint import pprint
path <- "/Volumes/Informatics/telatin/qibx/ITS/"
prmr_funcn <- function(prmr) {
prmr_dna <- DNAString(prmr)
#!/usr/bin/env python3
A program to check that a list of programs is avalable retrieving their versions, if required.
Example configuration JSON (by default will look for 'checker.json' in the same directory as the program itself):
"binaries": {
"Zip": {
"params": ["-h"],
"binary": "zip",
"stdout": "Copyright",
Contig1 Contig2 Edge
Salmonella~virus~FSLSP030 k141_1850 82.900904361823
k141_1850 Salmonella~virus~FSLSP030 82.900904361823
Salmonella~virus~Chi k141_1850 77.68907855001756
k141_1850 Salmonella~virus~Chi 77.68907855001756
Salmonella~virus~FSLSP088 k141_1850 74.64006567255709
k141_1850 Salmonella~virus~FSLSP088 74.64006567255709
Salmonella~phage~118970_sal1 k141_1850 74.42229632318072
k141_1850 Salmonella~phage~118970_sal1 74.42229632318072

GitHub Emojis


Emoji Emoji Emoji
:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
telatin / bactsnp.def
Created December 7, 2020 16:56
Singularity definition for BactSNP
Bootstrap: docker
From: centos:centos7.6.1810
source /opt/software/conda/bin/activate /opt/software/conda_env
yum -y install epel-release wget which nano curl zlib-devel
telatin /
Created December 2, 2020 11:57
Retrieve papers by author ID (Google Scholar)
#!/usr/bin/env python3
from scholarly import scholarly
import sys
def stderr(*args, **kwargs):
print(*args, file=sys.stderr, **kwargs)
author_id = 'Bua3yncAAAAJ'
author = scholarly.search_author_id(author_id).fill()