Skip to content
Navigation Menu
Toggle navigation
Sign in
In this repository
All GitHub Enterprise
↵
Jump to
↵
No suggested jump to results
In this repository
All GitHub Enterprise
↵
Jump to
↵
In this organization
All GitHub Enterprise
↵
Jump to
↵
In this repository
All GitHub Enterprise
↵
Jump to
↵
Sign in
Reseting focus
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
loosolab
/
master_project_JLU2018
Public
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Issues
7
Pull requests
1
Actions
Projects
0
Wiki
Security
Insights
Additional navigation options
Code
Issues
Pull requests
Actions
Projects
Wiki
Security
Insights
Files
53b0857
bin
1.1_footprint_extraction
1.2_filter_motifs
2.1_clustering
2.2_motif_estimation
3.1_create_gtf
Modules
Ensembl
FTPHandling
__pycache__
FTPEntry.py
URLRetrieve.py
VersionChecker.py
__init__.py
__pycache__
ActivityCategorizer.py
ActivityTable.py
ActivityTableGenerator.py
Ensembl.py
GTFGen.py
__init__.py
checksums.py
__pycache__
ucsc
CrossMap.py
CrossMapper.py
SaveResults.py
Uniquifier.py
__init__.py
config
data
RegGTFExtractor.py
config
README.md
masterenv.yml
nextflow.config
pipeline.nf
Breadcrumbs
master_project_JLU2018
/
bin
/
3.1_create_gtf
/
Modules
/
Ensembl
/
FTPHandling
/
URLRetrieve.py
Blame
Blame
Latest commit
History
History
40 lines (29 loc) · 1.19 KB
Breadcrumbs
master_project_JLU2018
/
bin
/
3.1_create_gtf
/
Modules
/
Ensembl
/
FTPHandling
/
URLRetrieve.py
Top
File metadata and controls
Code
Blame
40 lines (29 loc) · 1.19 KB
Raw
import ftplib from Modules.Ensembl.FTPHandling.FTPEntry import FTPEntry class FTPHandler: """ Class to browse through ftp folders and download entries to local file """ def __init__(self, url, wd): self.ftp = ftplib.FTP(url) self.ftp.login() self.ftp.cwd(wd) def change_dir(self, wd): self.ftp.cwd(wd) def get_all_entries(self): return self.ftp.nlst() def get_all_entries_from_dir(self, dire): self.change_dir(dire) return self.get_all_entries() def get_all_entries_as_FTPEntry(self): # Get All Files files = self.ftp.nlst() return [FTPEntry(item, self.ftp, self.ftp.pwd()) for item in files] def save_entries_to_file(self, origin, target): self.change_dir(origin) for file in self.get_all_entries_as_FTPEntry(): if file.gettype() == "f": # Download only Checksum & gff.gz files if file.getfilename() not in ["README", "manifest.tsv"]: print("Downloading....... > " + file.getfilename()) self.ftp.retrbinary("RETR " + file.getfilename(), open(target + "/" + file.getfilename(), 'wb').write)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
You can’t perform that action at this time.