-
Notifications
You must be signed in to change notification settings - Fork 1
/
FastqMatchConfigure.pl
47 lines (38 loc) · 1.29 KB
/
FastqMatchConfigure.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#!/usr/bin/perl -w
# Collect Single-end and Pired-end Fastq files (Downloaded from SRA database)
# Then Bismark could recongize them to decide single-end or pair-end aligment.
# Run the script to the Fastq directory
# Contact: Shicheng Guo
# Version 1.3
# Update: 2016-08-19
use strict;
use Cwd;
USAGE();
chdir getcwd;
open OUT,">FastqMatchConfig.txt";
my %sam;
my @fastq=glob("*fastq.gz");
foreach my $fastq(@fastq){
my($sample,undef)=split /[_.]/,$fastq;
$sam{$sample}++;
}
foreach my $sam (sort keys %sam){
if($sam{$sam}>1){
print OUT "$sam\_1.fastq.gz\t$sam\_2.fastq.gz\n"
}else{
print OUT "$sam\_1.fastq.gz\n";
}
}
close OUT;
sub USAGE{
print "\nUSAGE: perl $0\n";
print '
--------------------------------------------------------------------------------------------------------------------------
This command creat input(configure) files for bismarker alignment.
Single-end Fastq contains one file each line.
Pair-end Fastq file contains two files each line.
bismark2bamPBS.pl could recognize this file and take it (FastqMatchConfig.txt) as input to make alignment for BS-seq data.
--------------------------------------------------------------------------------------------------------------------------
Fastq Match Files was saved in current directory as: FastqMatchConfig.txt
';
}