Redian新闻
>
ask for help for R programming (转载)
avatar
ask for help for R programming (转载)# DataSciences - 数据科学
M*A
1
何美湄:SB1266幫助有過敏性的在校學童
Senator Bob Huff 的SB1266提案旨在幫助有過敏性的在校學童。加州目前的法律是允
許學生自己可以攜帶抗過敏藥物上學。2013年7月一個13歲的女孩Natalie Giorgi因不
愖吃了帶有花生的食物引發過敏,因自己帶的抗過敏藥物不足,學校又沒備有藥物,因
來不及搶救而去逝。SB1266 要求學校要準備抗過敏藥物(俗稱EpiPens)並准許受過訓
練的老師可以施打藥物。據統計加州大約有百分之六的學童有過敏性反應而不自知。不
過這麼一個可以及時救助學童的一個common sense的法案仍然遭到敎師工會的反抗。
Battle over EpiPens in schools pits politics against kids' safety
Current state law allows children with diagnosed allergies to keep their
prescribed epinephrine auto-injectors, commonly known under the brand name
EpiPen, at school in case of a reaction. It's a good law, but it leaves out
all the children who have no idea whether they have severe allergies.
Senate Republican leader Bob Huff of Diamond Bar has a bill that would fix
the oversight and require schools to keep a stock of epinephrine auto-
injectors and train some school personnel to use them in an emergency. But
this potentially lifesaving legislation is being fought by teachers unions
unhappy with the shifting of duties from school nurses to teachers.
# # #
Senator Huff serves as the Senate Republican Leader and represents the 29th
Senate District covering portions of Los Angeles, Orange and San Bernardino
Counties.
avatar
w*1
2
【 以下文字转载自 Statistics 讨论区 】
发信人: wz99331 (dotti), 信区: Statistics
标 题: ask for help for R programming
发信站: BBS 未名空间站 (Thu Oct 16 15:25:16 2014, 美东)
I need to transpose a file to example.txt
the final dataset should be sorted by chr first then by position. Could
anyone help me to write the R code? Thank you very much!
raw data:
snp Chr pos Sample.ID Allele1 Allele2
rs6269442 1 1.614 517 A B
rs13475701 1 1.744 517 A B
rs13475706 1 1.889 517 A B
rs3684358 1 2.06 517 A B
rs13475729 1 3.749 517 A B
rs3671256 1 5.009 517 A B
rs13475750 1 6.153 517 A B
rs6404446 1 6.442 517 A B
rs31949292 1 8.486 517 A B
rs6173215 1 8.692 517 A B
rs31917015 1 10.425 517 A B
rs6166266 1 10.731 517 A B
rs3677683 1 10.932 517 A B
rs3695988 1 11.345 517 A B
rs4137502 1 11.461 517 A B
.
.
.
example.txt
snp chr pos sampel.id1 sample.id2 .........
rs6269442 1 1.614 AB AB
rs13475701 1 1.744 AA AB
rs13475706 1 1.889 AA AB
rs3684358 1 2.06 AB BB
rs13475729 1 3.749 AB BB
rs3671256 1 5.009 AB BB
rs13475750 1 6.153 AB AB
rs6404446 1 6.442 AB AB
rs31949292 1 8.486 AB AB
rs6173215 1 8.692 AB AB
rs31917015 1 10.425 AB AB
rs6166266 1 10.731 AB AB
rs3677683 1 10.932 AB AB
rs3695988 1 11.345 AB AB
rs4137502 1 11.461 AB AB
.
.
.
avatar
y*1
3
This bill makes sense to me. It seems a real one to benefit the kids with
allergy.
avatar
k*e
4
ordered = raw[order(raw$Chr, raw$pos),]

【在 w*****1 的大作中提到】
: 【 以下文字转载自 Statistics 讨论区 】
: 发信人: wz99331 (dotti), 信区: Statistics
: 标 题: ask for help for R programming
: 发信站: BBS 未名空间站 (Thu Oct 16 15:25:16 2014, 美东)
: I need to transpose a file to example.txt
: the final dataset should be sorted by chr first then by position. Could
: anyone help me to write the R code? Thank you very much!
: raw data:
: snp Chr pos Sample.ID Allele1 Allele2
: rs6269442 1 1.614 517 A B

avatar
o*e
5
zan!
avatar
w*1
6
this is only to order the data, did not transpose the snp id so that each
column is for one sample id, currently each sample has many snps.
avatar
w*1
7
there are about 1000 sample ids, I only list the first sample id.
avatar
P*6
8
用个loop 不就行了。你又不追求速度

【在 w*****1 的大作中提到】
: there are about 1000 sample ids, I only list the first sample id.
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。