Skip to content

Instantly share code, notes, and snippets.

View irusri's full-sized avatar
🌱

Chanaka Mannapperuma irusri

🌱
View GitHub Profile
@irusri
irusri / column_transpose.md
Last active November 19, 2023 13:54
transpose column to rows
awk 'NR==1{n=split($0,c);next} {for(i=1;i<=n;i++)s[++t]=$1 FS c[i] FS $(i+1)} END{for(i=1;i<=t;i++){print s[i]}} ' file

input

-1	1	-2	2	-3	apical(-4+-5)	0
Potra2c131s34674	0.104987	0	0	0	0	0	0
Potra2c131s34675	1.53804	1.23118	0	4.14176	0.722722	0.81614	4.01801
Potra2c131s34685	22.256	68.5207	25.7406	109.441	18.7148	21.8992	36.6248
@irusri
irusri / RSS_feed_filter_by_pubDate.php
Last active November 19, 2023 09:27
RSS feed filter by pubDate
<?php
// GET '$rss_feed_url' using URL param['q']
$rss_feed_url = $_GET['q'];
// Load the RSS feed
$tmpRSS = simplexml_load_file($rss_feed_url);
// Get today's date in the format used by pubDate in the RSS feed
$today_date = date('D, d M Y');
{
"data": {
"nodes": {
"0": {
"count": 1,
"distance": 0,
"objects": [
"Potra2n10c20318"
],
"features": [
@irusri
irusri / tange_of_visibility,md
Last active January 28, 2021 09:46
Range of visibility
╔══════════════════╦══════════╦═════════════╗
β•‘ β•‘ Dipped β•‘ Main beam β•‘
╠══════════════════╬══════════╬═════════════╣
β•‘ Dark clothes β•‘ 20-30 m β•‘ 150 m β•‘
β•‘ Bright clothes β•‘ 60 m β•‘ 300 m β•‘
β•‘ With Reflectors β•‘ 125 m β•‘ 400 - 450 m β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•©β•β•β•β•β•β•β•β•β•β•β•©β•β•β•β•β•β•β•β•β•β•β•β•β•β•
@irusri
irusri / genie_single_db.sql
Created January 19, 2021 07:39
Database schema for using single database in PlantGenIE
SET NAMES utf8;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for `annotation`
-- ----------------------------
DROP TABLE IF EXISTS `annotation`;
CREATE TABLE `annotation` (
`gene_id` varchar(50) NOT NULL,
@irusri
irusri / genie_multiple_db.sql
Created January 19, 2021 07:38
Database schema for using multiple databases in PlantGenIE
/*
Proposed database design for PlantGenIE
*/
SET NAMES utf8;
SET FOREIGN_KEY_CHECKS = 0;
-- ----------------------------
-- Table structure for `expression`
-- ----------------------------
version: '3.1'
services:
geniesys:
image: "irusri/docker4geniesys:latest"
ports:
- "80:80"
- "3002:3006"
environment:
- "MYSQL_ADMIN_PASS=mypass"
volumes:

Creating Phylogenetic trees

Here are the steps that we used to create the Phylogenetic tree for ortholog genes descibed in the paper.

1.) We have to extract the protein sequences from Phytozome genome portal.

2.) We made BLAST indices using the following command for Eucalyptus grandis v2.0, Malus domestica v1.0, Salix purpurea v1.0, Theobroma cacao v2.1, Citrus sinensis v1.1, Prunus persica v1.0 and Betula pendula v1.0 sequences.

####
@irusri
irusri / qnorm.js
Created April 15, 2020 04:35 — forked from dtuite/qnorm.js
qnorm.js
// Originally found at: http://rangevoting.org/Qnorm.html
/** * @(#)qnorm.js * * Copyright (c) 2000 by Sundar Dorai-Raj
* * @author Sundar Dorai-Raj
* * Email: sdoraira@vt.edu
* * This program is free software; you can redistribute it and/or
* * modify it under the terms of the GNU General Public License
* * as published by the Free Software Foundation; either version 2
* * of the License, or (at your option) any later version,
* * provided that any use properly credits the author.
@irusri
irusri / mysql_debian_user.md
Created February 10, 2020 23:39 — forked from jaircuevajunior/mysql_debian_user.md
Fix logrotate error regarding mysql on Ubuntu

Fix logrotate error regarding mysql on Ubuntu

Sometimes if you are mailed of cronjobs, will may got an error like this:

/etc/cron.daily/logrotate:
error: error running shared postrotate script for '/var/log/mysql.log /var/log/mysql/mysql.log /var/log/mysql/mysql-slow.log /var/log/mysql/error.log '
run-parts: /etc/cron.daily/logrotate exited with return code 1

Well, don't panic! Also don't ignore it! :)