l******o 发帖数: 3764 | 1 100个snp, snp1-snp100,
每个snp有3种可能的genotype 比如AA AT TT
怎么样按genotype frequency high->low 给这三个基因型赋值 0 1 2?
补充一下 大概我说的太不清楚了 而且我忘记说明问的是SAS code 不好意思
我不是问怎么求每个SNP的allele frequency
而是想问有什么批量处理的方法能自动检测每个SNP的genotype frequency并且recode成0 1 2
感觉大家给我的建议都是手动一个个的操作啊
如果不是这个意思的话 还请高手们给点详细的建议
多谢多谢 |
m*****s 发帖数: 156 | 2 I am not sure what you want to do, but typical coding by allele frequency is
done like this. First calculate the allele frequencies of A,T and determine
the minor allele (frequency<0.5). Using the minor allele as reference
allele, you can code the three genotype by the count of the reference allele
. For example, if you have reference allele A, then code like this, AA->2,
AT->1, and TT->0
【在 l******o 的大作中提到】 : 100个snp, snp1-snp100, : 每个snp有3种可能的genotype 比如AA AT TT : 怎么样按genotype frequency high->low 给这三个基因型赋值 0 1 2? : 补充一下 大概我说的太不清楚了 而且我忘记说明问的是SAS code 不好意思 : 我不是问怎么求每个SNP的allele frequency : 而是想问有什么批量处理的方法能自动检测每个SNP的genotype frequency并且recode成0 1 2 : 感觉大家给我的建议都是手动一个个的操作啊 : 如果不是这个意思的话 还请高手们给点详细的建议 : 多谢多谢
|
a****g 发帖数: 8131 | 3 写个macro挨个赋值
坐等更高级的解法出现
【在 l******o 的大作中提到】 : 100个snp, snp1-snp100, : 每个snp有3种可能的genotype 比如AA AT TT : 怎么样按genotype frequency high->low 给这三个基因型赋值 0 1 2? : 补充一下 大概我说的太不清楚了 而且我忘记说明问的是SAS code 不好意思 : 我不是问怎么求每个SNP的allele frequency : 而是想问有什么批量处理的方法能自动检测每个SNP的genotype frequency并且recode成0 1 2 : 感觉大家给我的建议都是手动一个个的操作啊 : 如果不是这个意思的话 还请高手们给点详细的建议 : 多谢多谢
|
l******o 发帖数: 3764 | 4 是啊
可是frequency这一步怎么得啊?
is
determine
allele
【在 m*****s 的大作中提到】 : I am not sure what you want to do, but typical coding by allele frequency is : done like this. First calculate the allele frequencies of A,T and determine : the minor allele (frequency<0.5). Using the minor allele as reference : allele, you can code the three genotype by the count of the reference allele : . For example, if you have reference allele A, then code like this, AA->2, : AT->1, and TT->0
|
l******o 发帖数: 3764 | 5 能给具体写写吗?
我就是不知道用什么得到frequency
【在 a****g 的大作中提到】 : 写个macro挨个赋值 : 坐等更高级的解法出现
|
b*****n 发帖数: 685 | 6 you mean allele frequency or what? |
q********i 发帖数: 795 | 7 plink --recodeAD --out 不是直接都给出的吗?
【在 l******o 的大作中提到】 : 100个snp, snp1-snp100, : 每个snp有3种可能的genotype 比如AA AT TT : 怎么样按genotype frequency high->low 给这三个基因型赋值 0 1 2? : 补充一下 大概我说的太不清楚了 而且我忘记说明问的是SAS code 不好意思 : 我不是问怎么求每个SNP的allele frequency : 而是想问有什么批量处理的方法能自动检测每个SNP的genotype frequency并且recode成0 1 2 : 感觉大家给我的建议都是手动一个个的操作啊 : 如果不是这个意思的话 还请高手们给点详细的建议 : 多谢多谢
|
l******o 发帖数: 3764 | 8 是的 可能说的不太清楚 不好意思
【在 b*****n 的大作中提到】 : you mean allele frequency or what?
|
b*****n 发帖数: 685 | 9 一加一除不就得了。
【在 l******o 的大作中提到】 : 是的 可能说的不太清楚 不好意思
|
l******o 发帖数: 3764 | 10 一百个snp都手动一加一除?
【在 b*****n 的大作中提到】 : 一加一除不就得了。
|
l******o 发帖数: 3764 | 11 补充一下 不知道是不是我说的太不清楚了
我不是问怎么求每个SNP的allele frequency
而是想问有什么批量处理的方法能自动检测每个SNP的genotype frequency并且recode
成0 1 2
感觉大家给我的建议都是手动一个个的操作啊
如果不是这个意思的话 还请高手们给点详细的建议
多谢多谢 |
m*****s 发帖数: 156 | 12 R, SAS, or other programs you are familiar with
recode
【在 l******o 的大作中提到】 : 补充一下 不知道是不是我说的太不清楚了 : 我不是问怎么求每个SNP的allele frequency : 而是想问有什么批量处理的方法能自动检测每个SNP的genotype frequency并且recode : 成0 1 2 : 感觉大家给我的建议都是手动一个个的操作啊 : 如果不是这个意思的话 还请高手们给点详细的建议 : 多谢多谢
|
a********s 发帖数: 188 | 13 You can write a SAS Macro to assign 0,1,2 to each SNP, one by one. If you
want, you can refer the following steps:
(1) Use PROC CONTENTS and PROC SQL to output all SNP names into a macro
variable, separated by " "
(2) Use DO WHILE ... (statement) ... END to assign 0,1,2 to each snp based
on alleles' frequencies.
(2.1) Inside the (statement), use PROC FREQ, and data MERGE functions to
calculate frequencies, assign 0,1,2, and merge dataset |