原创 定量資料與定性資料

一、定量資料: 測定每個觀察單位某項指標量的大小。 計量資料: 在定量資料中,若指標的取值可以帶度量衡單位,甚至可以帶小數(標誌測量的精度)的定量資料,就叫“計量資料”。例如測得正常成年男子身高cm) 、體重kg ) 、血紅蛋白g

原创 1.Seqtk--fasta/fastq文件處理工具

sudo apt install seqtk seqtk Usage: seqtk <command> <arguments> Version: 1.2-r94 Command: seq common tran

原创 統計fasta文件GC含量【Perl】

#!/usr/bin/perl -w use strict; my $file="myseq.fa"; open(FH,$file) or die $!; my $G_num=0; my $C_num=0; my $g_num=

原创 導入模塊實例【PERL】

自定義模塊(iprint.pm文件) package iprint; require Exporter; our @ISA = qw(Exporter); our @EXPORT = qw(ihash); sub ihash{

原创 R語言求特徵值和特徵向量

> a=diag(4)+1 > a [,1] [,2] [,3] [,4] [1,] 2 1 1 1 [2,] 1 2 1 1 [3,] 1 1 2

原创 統計fasta文件每條序列的長度【Perl】

#!/usr/bin/perl -w use strict; my $file="myseq.fa"; open(FH,$file) or die $!; my %hash; my $id=0; while(<FH>){ c

原创 R語言畫圖,很全!對號使用!

創建數據 num=seq(10378001,10378100) x1=round(runif(100,min=80,max=100)) x2=round(rnorm(100,mean=80,sd=7)) x3=round(rnor

原创 模擬遺傳漂變【PERL】

#!/usr/bin/perl -w use strict; my $DNA="AAAAAAAAAAAAAAAAAAAAAA"; my ($i,$mutant); srand(time|$$); $mutant=mutate

原创 外部鏈接和內部鏈接,臨時性定義,extern,static

外部鏈接和內部鏈接 參見 https://blog.csdn.net/xiexievv/article/details/8487373 ,非常詳細! 補充1: 不完全聲明 struct s; union u; char str

原创 27.巴比倫塔(UVa 437)

有n(n≤30)n(n≤30)n(n≤30)種立方體,每種都有無窮多個。要求選一些立方體摞成一根儘量高的柱子(可以自行選擇哪一條邊作爲高),使得每個立方體的底面長寬分別嚴格小於它下方立方體的底面長寬。 #include <iost

原创 進程間通信無名pipe和有名fifo(Linux,C)

1. 無名管道(PIPE) #include <stdlib.h> #include <unistd.h> #define MAXLINE 80 int main(void){ int n; int fd[2]; // 管道

原创 基於TCP協議,簡單的網絡程序(Linux,C)

代碼 /* server.c */ #include <stdio.h> #include <stdlib.h> #include <string.h> #include <unistd.h> #include <sys/sock

原创 26.城市裏的間諜 (UVa1025)

某城市的地鐵是線性的,有n(2≤n≤50)n(2≤n≤50)n(2≤n≤50)個車站,從左到右編號爲1~n1~n1~n。有M1M1M1輛列車從第1站開始往右開,還有M2M_2M2​輛列車從第nnn站開始往左開。在時刻000,Mar

原创 全面詳解sizeof

#include <stdio.h> using namespace std; int main(void){ printf("len_char=%d\nlen_int=%d\nlen_signed_int=%d\nlen_u

原创 字符串字面值,段錯誤

字符串字面值也可以像數組名一樣使用,可以加下標訪問其中的字符: 正確: char c = "Hello, world.\n"[0]; 但是通過下標修改其中的字符卻是不允許的: 錯誤: "Hello, world.\n"[0] =