Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bioinfo_utils
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Blaise LI
bioinfo_utils
Commits
da94c9ce
Commit
da94c9ce
authored
8 years ago
by
Blaise Li
Browse files
Options
Downloads
Patches
Plain Diff
Added scripts to run and parse fastqc.
parent
efeff4cd
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
do_qc.sh
+35
-0
35 additions, 0 deletions
do_qc.sh
parse_fastqc.py
+22
-0
22 additions, 0 deletions
parse_fastqc.py
with
57 additions
and
0 deletions
do_qc.sh
0 → 100755
+
35
−
0
View file @
da94c9ce
#!/bin/bash
# http://linuxcommand.org/wss0150.php
PROGNAME
=
$(
basename
$0
)
function
error_exit
{
# ----------------------------------------------------------------
# Function for exit due to fatal program error
# Accepts 1 argument:
# string containing descriptive error message
# ----------------------------------------------------------------
echo
"
${
PROGNAME
}
:
${
1
:-
"Unknown Error"
}
"
1>&2
exit
1
}
lib
=
${
1
}
report_dir
=
"
${
lib
}
_fastqc"
if
[
!
-e
${
report_dir
}
.zip
-a
!
-e
${
report_dir
}
]
then
cmd
=
"fastqc
${
lib
}
.fastq.gz"
nice
-n
19 ionice
-c2
-n7
${
cmd
}
||
error_exit
"
${
cmd
}
failed"
fi
if
[
!
-e
${
report_dir
}
]
then
unzip
${
report_dir
}
.zip
fi
parse_fastqc.py
${
report_dir
}
/fastqc_data.txt
\
>
${
report_dir
}
/
${
lib
}
_overrepresented.fasta
\
||
error_exit
"fastqc result parsing failed for
${
lib
}
"
exit
0
This diff is collapsed.
Click to expand it.
parse_fastqc.py
0 → 100755
+
22
−
0
View file @
da94c9ce
#!/usr/bin/env python3
import
sys
with
open
(
sys
.
argv
[
1
],
"
r
"
)
as
fqc
:
line
=
fqc
.
readline
()
assert
line
.
startswith
(
"
##FastQC
"
)
while
not
line
.
startswith
(
"
>>Overrepresented sequences
"
):
line
=
fqc
.
readline
()
seq
,
count
,
percent
,
source
=
fqc
.
readline
().
strip
().
split
(
"
\t
"
)
assert
seq
==
"
#Sequence
"
#cumul_percent = 0
line
=
fqc
.
readline
()
order
=
0
while
not
line
.
startswith
(
"
>>END_MODULE
"
):
seq
,
_
,
percent
,
_
=
line
.
strip
().
split
(
"
\t
"
)
order
+=
1
#cumul_percent += float(percent)
print
(
"
>Over_represented_%d (%s)
\n
%s
"
%
(
order
,
percent
,
seq
))
line
=
fqc
.
readline
()
sys
.
exit
(
0
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment