Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
scripts
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
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
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
UNLOCK
scripts
Commits
c16434f0
Commit
c16434f0
authored
3 years ago
by
Bart
Browse files
Options
Downloads
Patches
Plain Diff
bin assembly stats script
parent
9f055c2d
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin_assembly_stats.sh
+19
-0
19 additions, 0 deletions
bin_assembly_stats.sh
with
19 additions
and
0 deletions
bin_assembly_stats.sh
0 → 100755
+
19
−
0
View file @
c16434f0
#!/bin/bash
# Loops through a folder of fasta files and calculates #contigs, total length, N50, largst contig and GC%.
# (also works on gzipped fasta files)
#
# The raw_n50 executeable comes from the idba_ud assembler.
echo
-e
'bin\tcontigs\ttotal_length\tN50\tlargest\tGC%'
for
filepath
in
`
ls
$1
/
*
.fa
*
`
;
do
bin
=
$(
basename
$filepath
|
sed
s
'/.fa.*//'
g
)
raw_n50_stats
=
$(
/unlock/infrastructure/binaries/raw_n50
$filepath
)
GC
=
$(
grep
-v
">"
$filepath
|
sed
-e
's/\(.\)/\1\n/g'
|
grep
-c
"G
\|
C"
)
size
=
$(
echo
$raw_n50_stats
|
awk
'{print $11}'
)
GCcontent
=
$(
echo
|
awk
-v
GC
=
$GC
-v
size
=
$size
'{printf "%.2f", GC/size*100}'
)
stats
=
$(
echo
$raw_n50_stats
|
awk
'{print $2"\t"$11"\t"$4"\t"$6}'
)
echo
-e
$bin
"
\t
"
$stats
"
\t
"
$GCcontent
|
sed
's/ /\t/g'
done
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