-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ID, motifs, and motif counts to VCF #2
base: main
Are you sure you want to change the base?
Conversation
pub fn create_mc(motifs_string: &str, repeats: &str) -> String { | ||
let motifs: Vec<String> = motifs_string.split(',').map(|s| s.to_string()).collect(); | ||
|
||
let mut motif_counts = vec![0; motifs.len()]; | ||
for motif in motifs.iter() { | ||
let mut start = 0; | ||
while let Some(index) = repeats[start..].find(motif) { | ||
motif_counts[motifs.iter().position(|x| x == motif).unwrap()] += 1; | ||
start += index + motif.len(); | ||
} | ||
} | ||
motif_counts.iter().map(|count| count.to_string()).collect::<Vec<String>>().join("_") | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will not work when the motif contains N though...
Hi @fellen31 Wouter |
Adds ID, motifs, and motif counts to the output VCF:
chr4 39348424 . AAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGA AAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAG,AAAAAGAAAAGAAAAGAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAGAAAAG . . REPID=RFC1;MOTIFS=AAAAG,AAAGG,AAGGG,AAGAG,AGAGG,AACGG,GGGAC,AAAGGG;END=39348479;STDEV=2,7 GT:RB:FRB:SUP:MC:SC 1|2:6,520:61,575:17,14:12_0_0_0_0_0_0_0,114_0_0_0_0_0_0_0:183,1725