Skip to content

Instantly share code, notes, and snippets.

BenchmarkDotNet=v0.10.14, OS=Windows 10.0.16299.371 (1709/FallCreatorsUpdate/Redstone3)
Intel Core i7-7820HQ CPU 2.90GHz (Kaby Lake), 1 CPU, 8 logical and 4 physical cores
Frequency=2835937 Hz, Resolution=352.6171 ns, Timer=TSC
  [Host]     : .NET Framework 4.7.1 (CLR 4.0.30319.42000), 32bit LegacyJIT-v4.7.2633.0
  Job-JWVBYN : .NET Framework 4.7.1 (CLR 4.0.30319.42000), 32bit LegacyJIT-v4.7.2633.0

Runtime=Clr  IsBaseline=True  
using System;
namespace CombinatoricsLib
{
public class Combinations
{
private static ulong Factorial(int x, int until = 0)
{
ulong res = 1;
while (x != until)
@pgsin
pgsin / MappingProgram.cs
Created July 17, 2018 23:43
Mapping database identifiers
using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Text;
public class MappingExample
{
private const string UniprotServer = "https://www.uniprot.org/";
using System;
using System.Collections.Generic;
using System.IO;
using System.Net;
using System.Text;
public class MappingExample
{
private const string UniprotServer = "https://www.uniprot.org/";
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using TensorFlow;
namespace MachineLearning
{
@pgsin
pgsin / MakeTable.cs
Last active September 13, 2018 22:32
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text.RegularExpressions;
namespace ImmunopepModel
{
public class Gene
{
@pgsin
pgsin / Snakefile
Last active August 16, 2019 22:11
import os
import re
GENOME = 'data/22'
rule all:
input: expand('output/reports/{SAMPLE}', SAMPLE=[os.path.splitext(i)[0] for i in os.listdir('input/') if not i.startswith('.') and i.endswith(".bam")])
output: touch('output/done')
rule reference_index:
@pgsin
pgsin / getGenBankByTaxonomy.py
Last active September 18, 2019 15:05
Get GenBank record of all strains of specific bacteria species
from Bio import Entrez
import os
import gzip
"""
To avoid problems with an access rate (ex. "HTTP Error 429: Too Many Requests")
Read how to get an api-key
https://ncbiinsights.ncbi.nlm.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 0.0, 0.0, 0.0, 0.0, 0.0, 0.0
@pgsin
pgsin / proteinGroups.txt
Created March 11, 2020 17:27
Protein groups from SMC1 interactomics tutorial
This file has been truncated, but you can view the full file.
Protein IDs Majority protein IDs Peptide counts (all) Peptide counts (razor+unique) Peptide counts (unique) Fasta headers Number of proteins Peptides Razor + unique peptides Unique peptides Peptides pHis3_01 Peptides pHis3_02 Peptides pHis3_03 Peptides SMC1_01 Peptides SMC1_02 Peptides SMC1_03 Razor + unique peptides pHis3_01 Razor + unique peptides pHis3_02 Razor + unique peptides pHis3_03 Razor + unique peptides SMC1_01 Razor + unique peptides SMC1_02 Razor + unique peptides SMC1_03 Unique peptides pHis3_01 Unique peptides pHis3_02 Unique peptides pHis3_03 Unique peptides SMC1_01 Unique peptides SMC1_02 Unique peptides SMC1_03 Sequence coverage [%] Unique + razor sequence coverage [%] Unique sequence coverage [%] Mol. weight [kDa] Sequence length Sequence lengths Q-value Score Sequence coverage pHis3_01 [%] Sequence coverage pHis3_02 [%] Sequence coverage pHis3_03 [%] Sequence coverage SMC1_01 [%] Sequence coverage SMC1_02 [%] Sequence coverage SMC1_03 [%] Intensity Intensity pHis3_01 Intensity pHis3_02 Int