Skip to content

Instantly share code, notes, and snippets.

View piroyon's full-sized avatar
🎼

Hiroyo NISHIDE piroyon

🎼
View GitHub Profile
@piroyon
piroyon / aws_g4dn_deeplabcut
Last active June 30, 2023 04:11
AWS G4dn + Deeplabcut 2.2.3 (Dec. 2022)
## AMI : ubuntu 22.04 (not use Deep Learning AMI) + EBS 30Gb
## INSTANCE : g4dn.4xlarge
$ sudo apt update
$ sudo apt install nvidia-driver-515 #(530 : /25/May/2023)
$ sudo apt install nvidia-cuda-toolkit
$ sudo apt install nvidia-utils-515 #(530 : /25/May/2023)
$ sudo reboot
$ nvidia-smi
@piroyon
piroyon / cigar.pl
Last active May 18, 2022 04:13
Calculate alignment length from CIGAR string (perl, subroutine)
sub cigarlen {
my $cigar = shift;
my @c = $cigar =~ /\d+[MI=X]/g;
my $len = 0;
foreach my $i (@c) {
$i =~ /(\d+)[MI=X]/;
$len += $1;
}
return $len;
}
@piroyon
piroyon / web_3dviewer_af2.js
Last active January 6, 2022 06:04
3Dmol.js + Alphafold2 plDDT
//<html>
//<script src="//code.jquery.com/jquery-3.6.0.js"></script>
//<script src="https://3Dmol.csb.pitt.edu/build/3Dmol-min.js""></script>
let element = $('#your_html_div_tag_id');
let config = { backgroundColor: 'mintcream' };
let viewer = $3Dmol.createViewer( element, config );
let pdb_file = '/path/to/alphafold2/results_file.pdb'
@piroyon
piroyon / ortholog_table.py3
Last active October 13, 2021 23:52
make_ortholog_dict
f = open('201110_allseq_colors.tsv', 'r')
orth_dict = {} ##初期化
color_dict = {}
for linen in f:
line = linen.rstrip() ##改行の削除
values = line.split("\t")
ortholog_id = values[0]
orth_dict.setdefault(ortholog_id, {}) ##1段目の辞書初期化
@piroyon
piroyon / getTPM.pl
Last active December 21, 2022 01:40
Get FPKM and TPM from a result gtf file of stringtie
#!/usr/bin/env perl
use strict;
use warnings;
use Getopt::Std;
use Pod::Usage;
pod2usage() unless @ARGV;
=pod
@piroyon
piroyon / rss_slackpost.php
Last active April 17, 2020 04:21
Check RSS feed and post to slack, if there is a new article
<?php
// Usage: /usr/bin/php rss_slackpost.php
// Require: php-xmlrpc, php-cli
// Make slack app. and get slackapikey, then invite bot
// $ cat feedlog.txt --> The URL of the newest article in the last check
// https://example.org/wp/archives/178
ini_set("auto_detect_line_endings", true);
@piroyon
piroyon / d3_table_svg.html
Last active July 16, 2019 01:46
D3 put svg on table
<!DOCTYPE html>
<meta charset="utf-8">
<meta http-equiv="Refresh" content="60">
<script src="http://d3js.org/d3.v3.min.js"></script>
<div id="vis"></div>
<script>
var url = 'http://aaa.bbb.ccc/cgi-bin/getstatus.pl';
@piroyon
piroyon / getPaper_fromDOI.pl
Last active April 15, 2019 02:38
get the details of the paper from DOI list
#!/usr/bin/perl
=head1 SCRIPT NAME
getPaper_fromDOI.pl
=head1 DESCRIPTION
Get the details of the paper from DOI using crossref API.
@piroyon
piroyon / diamond2b2g.pl
Last active April 21, 2020 06:49
Format the result of diamond (vs.nr) xml file for blast2go
#!/usr/bin/perl
=head1 SCRIPT NAME
diamond2b2g.pl
=head1 DESCRIPTION
Format the result of diamond (vs.nr) xml file for blast2go
@piroyon
piroyon / sge2pbs.pl
Last active June 11, 2018 06:52
Rewrite SGE script to PBS script
#!/usr/bin/perl
=head1 SCRIPT NAME
sge2pbs.pl
=head1 DESCRIPTION
Rewrite SGE script to PBS script
=head1 USAGE
perl sge2pbs.pl sge_sh_script_file > pbs_sh_script_file
=cut