Mercurial > repos > chrisd > testing
annotate gene_fraction/src/main.cpp @ 0:f95150c37d38 draft default tip
planemo upload for repository https://github.com/ChrisD11/Tools commit ddc95e5d6b5f2c0a5340c0bc384aa822db8856d5
| author | chrisd | 
|---|---|
| date | Sun, 21 Feb 2016 23:31:55 -0500 | 
| parents | |
| children | 
| rev | line source | 
|---|---|
| 
0
 
f95150c37d38
planemo upload for repository https://github.com/ChrisD11/Tools commit ddc95e5d6b5f2c0a5340c0bc384aa822db8856d5
 
chrisd 
parents:  
diff
changeset
 | 
1 #include <string> | 
| 
 
f95150c37d38
planemo upload for repository https://github.com/ChrisD11/Tools commit ddc95e5d6b5f2c0a5340c0bc384aa822db8856d5
 
chrisd 
parents:  
diff
changeset
 | 
2 #include <iostream> | 
| 
 
f95150c37d38
planemo upload for repository https://github.com/ChrisD11/Tools commit ddc95e5d6b5f2c0a5340c0bc384aa822db8856d5
 
chrisd 
parents:  
diff
changeset
 | 
3 #include <vector> | 
| 
 
f95150c37d38
planemo upload for repository https://github.com/ChrisD11/Tools commit ddc95e5d6b5f2c0a5340c0bc384aa822db8856d5
 
chrisd 
parents:  
diff
changeset
 | 
4 | 
| 
 
f95150c37d38
planemo upload for repository https://github.com/ChrisD11/Tools commit ddc95e5d6b5f2c0a5340c0bc384aa822db8856d5
 
chrisd 
parents:  
diff
changeset
 | 
5 #include "int_util.h" | 
| 
 
f95150c37d38
planemo upload for repository https://github.com/ChrisD11/Tools commit ddc95e5d6b5f2c0a5340c0bc384aa822db8856d5
 
chrisd 
parents:  
diff
changeset
 | 
6 #include "dir_util.h" | 
| 
 
f95150c37d38
planemo upload for repository https://github.com/ChrisD11/Tools commit ddc95e5d6b5f2c0a5340c0bc384aa822db8856d5
 
chrisd 
parents:  
diff
changeset
 | 
7 #include "args.h" | 
| 
 
f95150c37d38
planemo upload for repository https://github.com/ChrisD11/Tools commit ddc95e5d6b5f2c0a5340c0bc384aa822db8856d5
 
chrisd 
parents:  
diff
changeset
 | 
8 #include "Fasta.h" | 
| 
 
f95150c37d38
planemo upload for repository https://github.com/ChrisD11/Tools commit ddc95e5d6b5f2c0a5340c0bc384aa822db8856d5
 
chrisd 
parents:  
diff
changeset
 | 
9 #include "Sam.h" | 
| 
 
f95150c37d38
planemo upload for repository https://github.com/ChrisD11/Tools commit ddc95e5d6b5f2c0a5340c0bc384aa822db8856d5
 
chrisd 
parents:  
diff
changeset
 | 
10 #include "SamRatio.h" | 
| 
 
f95150c37d38
planemo upload for repository https://github.com/ChrisD11/Tools commit ddc95e5d6b5f2c0a5340c0bc384aa822db8856d5
 
chrisd 
parents:  
diff
changeset
 | 
11 | 
| 
 
f95150c37d38
planemo upload for repository https://github.com/ChrisD11/Tools commit ddc95e5d6b5f2c0a5340c0bc384aa822db8856d5
 
chrisd 
parents:  
diff
changeset
 | 
12 using namespace std; | 
| 
 
f95150c37d38
planemo upload for repository https://github.com/ChrisD11/Tools commit ddc95e5d6b5f2c0a5340c0bc384aa822db8856d5
 
chrisd 
parents:  
diff
changeset
 | 
13 | 
| 
 
f95150c37d38
planemo upload for repository https://github.com/ChrisD11/Tools commit ddc95e5d6b5f2c0a5340c0bc384aa822db8856d5
 
chrisd 
parents:  
diff
changeset
 | 
14 int main(int argc, char *argv[]) { | 
| 
 
f95150c37d38
planemo upload for repository https://github.com/ChrisD11/Tools commit ddc95e5d6b5f2c0a5340c0bc384aa822db8856d5
 
chrisd 
parents:  
diff
changeset
 | 
15 cmd_args args; | 
| 
 
f95150c37d38
planemo upload for repository https://github.com/ChrisD11/Tools commit ddc95e5d6b5f2c0a5340c0bc384aa822db8856d5
 
chrisd 
parents:  
diff
changeset
 | 
16 args = parse_command_line(argc, argv); | 
| 
 
f95150c37d38
planemo upload for repository https://github.com/ChrisD11/Tools commit ddc95e5d6b5f2c0a5340c0bc384aa822db8856d5
 
chrisd 
parents:  
diff
changeset
 | 
17 | 
| 
 
f95150c37d38
planemo upload for repository https://github.com/ChrisD11/Tools commit ddc95e5d6b5f2c0a5340c0bc384aa822db8856d5
 
chrisd 
parents:  
diff
changeset
 | 
18 Fasta f(args.amr_fp); | 
| 
 
f95150c37d38
planemo upload for repository https://github.com/ChrisD11/Tools commit ddc95e5d6b5f2c0a5340c0bc384aa822db8856d5
 
chrisd 
parents:  
diff
changeset
 | 
19 f.read_fasta(args.amr_fp); | 
| 
 
f95150c37d38
planemo upload for repository https://github.com/ChrisD11/Tools commit ddc95e5d6b5f2c0a5340c0bc384aa822db8856d5
 
chrisd 
parents:  
diff
changeset
 | 
20 | 
| 
 
f95150c37d38
planemo upload for repository https://github.com/ChrisD11/Tools commit ddc95e5d6b5f2c0a5340c0bc384aa822db8856d5
 
chrisd 
parents:  
diff
changeset
 | 
21 if(args.sam_dir) { | 
| 
 
f95150c37d38
planemo upload for repository https://github.com/ChrisD11/Tools commit ddc95e5d6b5f2c0a5340c0bc384aa822db8856d5
 
chrisd 
parents:  
diff
changeset
 | 
22 list<string> sam_files = parse_sam_dir(args.sam_fp); | 
| 
 
f95150c37d38
planemo upload for repository https://github.com/ChrisD11/Tools commit ddc95e5d6b5f2c0a5340c0bc384aa822db8856d5
 
chrisd 
parents:  
diff
changeset
 | 
23 for(auto &fn : sam_files) { | 
| 
 
f95150c37d38
planemo upload for repository https://github.com/ChrisD11/Tools commit ddc95e5d6b5f2c0a5340c0bc384aa822db8856d5
 
chrisd 
parents:  
diff
changeset
 | 
24 args.sam_fp = fn; | 
| 
 
f95150c37d38
planemo upload for repository https://github.com/ChrisD11/Tools commit ddc95e5d6b5f2c0a5340c0bc384aa822db8856d5
 
chrisd 
parents:  
diff
changeset
 | 
25 Sam s(args.sam_fp); | 
| 
 
f95150c37d38
planemo upload for repository https://github.com/ChrisD11/Tools commit ddc95e5d6b5f2c0a5340c0bc384aa822db8856d5
 
chrisd 
parents:  
diff
changeset
 | 
26 s.read_sam(args); | 
| 
 
f95150c37d38
planemo upload for repository https://github.com/ChrisD11/Tools commit ddc95e5d6b5f2c0a5340c0bc384aa822db8856d5
 
chrisd 
parents:  
diff
changeset
 | 
27 generate_samples(f.records, s.alignment, args); | 
| 
 
f95150c37d38
planemo upload for repository https://github.com/ChrisD11/Tools commit ddc95e5d6b5f2c0a5340c0bc384aa822db8856d5
 
chrisd 
parents:  
diff
changeset
 | 
28 } | 
| 
 
f95150c37d38
planemo upload for repository https://github.com/ChrisD11/Tools commit ddc95e5d6b5f2c0a5340c0bc384aa822db8856d5
 
chrisd 
parents:  
diff
changeset
 | 
29 } | 
| 
 
f95150c37d38
planemo upload for repository https://github.com/ChrisD11/Tools commit ddc95e5d6b5f2c0a5340c0bc384aa822db8856d5
 
chrisd 
parents:  
diff
changeset
 | 
30 else { | 
| 
 
f95150c37d38
planemo upload for repository https://github.com/ChrisD11/Tools commit ddc95e5d6b5f2c0a5340c0bc384aa822db8856d5
 
chrisd 
parents:  
diff
changeset
 | 
31 Sam s(args.sam_fp); | 
| 
 
f95150c37d38
planemo upload for repository https://github.com/ChrisD11/Tools commit ddc95e5d6b5f2c0a5340c0bc384aa822db8856d5
 
chrisd 
parents:  
diff
changeset
 | 
32 s.read_sam(args); | 
| 
 
f95150c37d38
planemo upload for repository https://github.com/ChrisD11/Tools commit ddc95e5d6b5f2c0a5340c0bc384aa822db8856d5
 
chrisd 
parents:  
diff
changeset
 | 
33 generate_samples(f.records, s.alignment, args); | 
| 
 
f95150c37d38
planemo upload for repository https://github.com/ChrisD11/Tools commit ddc95e5d6b5f2c0a5340c0bc384aa822db8856d5
 
chrisd 
parents:  
diff
changeset
 | 
34 } | 
| 
 
f95150c37d38
planemo upload for repository https://github.com/ChrisD11/Tools commit ddc95e5d6b5f2c0a5340c0bc384aa822db8856d5
 
chrisd 
parents:  
diff
changeset
 | 
35 | 
| 
 
f95150c37d38
planemo upload for repository https://github.com/ChrisD11/Tools commit ddc95e5d6b5f2c0a5340c0bc384aa822db8856d5
 
chrisd 
parents:  
diff
changeset
 | 
36 return 0; | 
| 
 
f95150c37d38
planemo upload for repository https://github.com/ChrisD11/Tools commit ddc95e5d6b5f2c0a5340c0bc384aa822db8856d5
 
chrisd 
parents:  
diff
changeset
 | 
37 } | 
