Esempi di statistica descrittiva e inferenziale/Analisi del proprio genoma: differenze tra le versioni

Contenuto cancellato Contenuto aggiunto
Nessun oggetto della modifica
Nessun oggetto della modifica
Riga 145:
5 Genome-wide association studies identify susceptibility loci for epithelial ovarian cancer in east Asian women.
6 Co-regulatory networks of human serum proteins link genetics to disease.
>
 
Si estraggono dal dataset le righe relative agli alleli di rischio contenuti nel genotipo del signore.Ad esempio se l'allele è T e nel genotipo si trova AT.
 
<syntaxhighlight lang="rsplus">
allele <- str_sub(output_data$STRONGEST.SNP.RISK.ALLELE, -1)
df <- data.frame()
for (r in 1:nrow(output_data) ) {
if (allele[r]=="?" | allele[r]=="*") next
if (str_detect(output_data[r,4], allele[r]))
df <- rbind(df,output_data[r,])
if(r%%1000==0) print(r)
}
 
df %>%
select(DISEASE.TRAIT, STRONGEST.SNP.RISK.ALLELE, genotype,STUDY) %>%
head()
</syntaxhighlight>
 
Si estraggono dal dataset le righe relative agli alleli di rischio contenuti nel genotipo del signore 2 volte. Ad esempio se l'allele è A e nel genotipo si trova AA.
{{avanzamento|25%|28 marzo 2021}}
 
 
 
<syntaxhighlight lang="rsplus">
df1 <- data.frame()
allele <- str_sub(df$STRONGEST.SNP.RISK.ALLELE, -1)
for (r in 1:nrow(df) ) {
if (str_count(df[r,4], allele[r])==2)
df1 <- rbind(df1,df[r,])
if(r%%1000==0) print(r)
}
 
v<-df1 %>%
select(DISEASE.TRAIT, STRONGEST.SNP.RISK.ALLELE, genotype,STUDY)
</syntaxhighlight>
 
 
<syntaxhighlight lang="rsplus">
df %>%
group_by(DISEASE.TRAIT) %>%
summarise(total =n())%>%
mutate(DISEASE.TRAIT=reorder(DISEASE.TRAIT,total)) %>%
filter(total>100) %>%
ggplot(aes(DISEASE.TRAIT,total, fill=DISEASE.TRAIT))+
geom_bar(stat="identity")+
coord_flip()+
geom_text(aes(label=total), hjust=0, size=2)+
guides(fill=FALSE)+
ylab("Numero totale di SNP") +
xlab("Malattia") +
ggtitle("Numero di SNP con singolo allele di rischio per malattia",subtitle = " maggiore di 100 nel genoma umano fornito")
</syntaxhighlight>
 
[[File:Numero di SNP per malattia con singolo allele di rischio nel genotipo.png|frame|centro]]
 
<syntaxhighlight lang="rsplus">
df1 %>%
group_by(DISEASE.TRAIT) %>%
summarise(total =n())%>%
mutate(DISEASE.TRAIT=reorder(DISEASE.TRAIT,total)) %>%
filter(total>50) %>%
ggplot(aes(DISEASE.TRAIT,total, fill=DISEASE.TRAIT))+
geom_bar(stat="identity")+
coord_flip()+
geom_text(aes(label=total), hjust=0, size=2)+
guides(fill=FALSE)+
ylab("Numero totale di SNP") +
xlab("Malattia") +
ggtitle("Numero di SNP con doppio allele di rischio per malattia",subtitle = " maggiore di 50 nel genoma umano fornito")
</syntaxhighlight>
 
[[File:Numero di SNP per malattia con doppio allele di rischio nel genotipo.png|frame|centro]]
 
Maggiore è il numero di SNP per malattia, maggiore è il rischio di ammalarsi . In ogni caso per ogni SNP si può leggere lo studio fornito tramite il suo link o cercarlo su SNPedia ...
 
 
{{avanzamento|2575%|28 marzo 2021}}
[[Categoria:Esempi di statistica descrittiva e inferenziale|Analisi del proprio genoma]]