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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Blaise LI
bioinfo_utils
Commits
8424f0b7
Commit
8424f0b7
authored
7 years ago
by
Blaise Li
Browse files
Options
Downloads
Patches
Plain Diff
Script to extract the most abundant reads.
parent
53909846
Branches
new_sample_size_filter
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
fastx_most_abundant.sh
+15
-0
15 additions, 0 deletions
fastx_most_abundant.sh
with
15 additions
and
0 deletions
fastx_most_abundant.sh
0 → 100755
+
15
−
0
View file @
8424f0b7
#!/bin/sh
# Extracts the most abundant sequences from a fastq of fasta file (the file can be gzipped)
# Outputs those reads in fasta format, the most abundant first, with their count as comment
# Usage: fastq2most_abundant.sh <fastq file> <number of top most abundant sequences wanted>
# Extract the sequence
# Sort and count
# Find the most abundant
# Format as fasta
bioawk
-c
fastx
'{print $seq}'
${
1
}
\
|
sort
|
uniq
-c
\
|
sort
-nr
|
head
-
${
2
}
\
| mawk
'{print ">"NR" ("$1")\n"$2}'
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