Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
mirflowz
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
Container registry
Model registry
Operate
Environments
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
zavolan_group
pipelines
mirflowz
Commits
9a2662c5
Commit
9a2662c5
authored
2 years ago
by
Iris Mestres Pascual
Browse files
Options
Downloads
Patches
Plain Diff
refactor: use local genome file
parent
d02e1a28
No related branches found
No related tags found
1 merge request
!26
refactor: use local files for genome resources
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/genome_process.sh
+13
-34
13 additions, 34 deletions
scripts/genome_process.sh
with
13 additions
and
34 deletions
scripts/genome_process.sh
+
13
−
34
View file @
9a2662c5
...
...
@@ -10,7 +10,7 @@
### DESCRIPTION ###
#####################
#
Download and p
rocess genome sequences fasta file
s
.
#
P
rocess genome sequences fasta file.
####################
### PARAMETERS ###
...
...
@@ -20,19 +20,14 @@
output_dir
=
"
$1
"
log_dir
=
"
$2
"
#
# Paths (DO NOT CHANGE!)
# Paths (DO NOT CHANGE!)
root
=
"
$PWD
"
#root="$(cd "$(dirname "$0" )" && pwd)"
fileDir
=
"
${
root
}
/test_files"
resDir
=
"
${
root
}
/
${
output_dir
}
"
rawDir
=
"
${
resDir
}
/raw"
logDir
=
"
${
root
}
/
${
log_dir
}
"
# URLs
# ------
# All URLs variables represent Bash arrays, so that multiple URLs can be provided; in that case,
# files are concatenated after download
genomeSeqURLs
=
"
$3
"
#Modified by Iborra P
# Genome File
genomeSeqFile
=
"
$3
"
########################
### PRE-REQUISITES ###
...
...
@@ -45,7 +40,6 @@ set -o pipefail
# Create directories
mkdir
--parents
"
$resDir
"
mkdir
--parents
"
$rawDir
"
mkdir
--parents
"
$logDir
"
# Create log file
...
...
@@ -57,37 +51,22 @@ rm -fr "$logFile"; touch "$logFile"
### MAIN ###
##############
## GET & FILTER GENE ANNOTATIONS
# Get genome sequences fasta files
echo
"Downloading genome sequences files..."
>>
"
$logFile
"
# wget -i "${genomeSeqURLs}" --output-document "${rawDir}/${fileNamePrefix}.genome.fa.gz"
# genomeSeq="${resDir}/${fileNamePrefix}.genome.fa.gz"
for
url
in
"
${
genomeSeqURLs
[@]
}
"
;
do
wget
"
$url
"
--output-document
"
${
rawDir
}
/
$(
basename
"
$url
"
)
"
&> /dev/null
done
# Concatenate genome sequences fasta files
echo
"Concatenating genome sequences files..."
>>
"
$logFile
"
genomeSeq
=
"
${
resDir
}
/genome.fa.gz"
for
url
in
"
${
genomeSeqURLs
[@]
}
"
;
do
cat
"
${
rawDir
}
/
$(
basename
"
$url
"
)
"
>>
"
$genomeSeq
"
done
# Trim genome sequences IDs
## TRIM GENOME SEQUENCES IDs
echo
"Triming genome sequenes IDs..."
>>
"
$logFile
"
genomeSeqTrim
=
"
${
resDir
}
/genome.processed.fa"
cp
"
${
genomeSeqFile
}
"
"
${
output_dir
}
/genome.fa.gz"
genomeSeq
=
"
${
output_dir
}
/genome.fa.gz"
gunzip
"
$genomeSeq
"
genomeSeq
=
"
${
resD
ir
}
/genome.fa"
genomeSeq
=
"
${
output_d
ir
}
/genome.fa"
awk
'{if ($1 ~ /^>/) {print $1} else {print $0}}'
"
$genomeSeq
"
>
"
$genomeSeqTrim
"
rm
"
${
resD
ir
}
/genome.fa"
rm
"
${
output_d
ir
}
/genome.fa"
#############
### END ###
#############
echo
"Original data in:
$
raw
Dir
"
>>
"
$logFile
"
echo
"Original data in:
$
file
Dir
"
>>
"
$logFile
"
echo
"Processed data in:
$resDir
"
>>
"
$logFile
"
echo
"Done. No errors."
>>
"
$logFile
"
>
&2
echo
"Done. No errors."
>
&2
echo
"Done. No errors."
\ No newline at end of file
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