Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
remove_duplicates_from_sorted_fastq
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
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Blaise LI
remove_duplicates_from_sorted_fastq
Commits
486af6fa
Commit
486af6fa
authored
5 months ago
by
Blaise Li
Browse files
Options
Downloads
Patches
Plain Diff
Can now process files given as command-line args.
parent
73c70285
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+7
-1
7 additions, 1 deletion
README.md
app/Main.hs
+20
-1
20 additions, 1 deletion
app/Main.hs
remove-duplicates-from-sorted-fastq.cabal
+1
-1
1 addition, 1 deletion
remove-duplicates-from-sorted-fastq.cabal
with
28 additions
and
3 deletions
README.md
+
7
−
1
View file @
486af6fa
...
...
@@ -42,4 +42,10 @@ fastq file provided in the `test` directory:
fastq-sort -s test/example.fq | remove-duplicates-from-sorted-fastq > test/dedup.fq
The resulting
`test/dedup.fq`
should be identical to
`test/dedup_expected.fq`
.
This can also be achieved in two steps:
fastq-sort -s test/example.fq > test/sorted.fq
remove-duplicates-from-sorted-fastq test/sorted.fq > test/dedup.fq
In both cases, the resulting
`test/dedup.fq`
should be identical to
`test/dedup_expected.fq`
.
This diff is collapsed.
Click to expand it.
app/Main.hs
+
20
−
1
View file @
486af6fa
{-# LANGUAGE OverloadedStrings #-}
module
Main
where
import
System.Environment
(
getArgs
)
-- For more efficient text manipulation
import
qualified
Data.ByteString.Lazy.Char8
as
C
...
...
@@ -66,5 +67,23 @@ text-formatted fastq records into a single text.
C.interact deals with the IO interaction, i.e. taking
text from the outside world and returning text to it.
-}
processStdin
::
IO
()
processStdin
=
C
.
interact
(
C
.
concat
.
processLines
.
C
.
lines
)
processPath
::
String
->
IO
()
processPath
path
=
do
fileContent
<-
(
C
.
readFile
path
)
C
.
putStr
((
C
.
concat
.
processLines
.
C
.
lines
)
fileContent
)
selectAction
::
[
String
]
->
IO
()
selectAction
[]
=
processStdin
selectAction
(
path
:
[]
)
=
do
processPath
path
selectAction
(
path
:
nextArgs
)
=
do
processPath
path
selectAction
nextArgs
main
::
IO
()
main
=
C
.
interact
(
C
.
concat
.
processLines
.
C
.
lines
)
main
=
do
args
<-
getArgs
selectAction
args
This diff is collapsed.
Click to expand it.
remove-duplicates-from-sorted-fastq.cabal
+
1
−
1
View file @
486af6fa
...
...
@@ -16,7 +16,7 @@ name: remove-duplicates-from-sorted-fastq
-- PVP summary: +-+------- breaking API changes
-- | | +----- non-breaking API additions
-- | | | +--- code changes with no API change
version: 0.1.
0
.0
version: 0.1.
1
.0
-- A short (one-line) description of the package.
-- synopsis:
...
...
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