geoseeq 0.6.14.dev4__py3-none-any.whl → 0.6.14.dev6__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
geoseeq/cli/download.py CHANGED
@@ -379,10 +379,10 @@ def cli_download_ids(state, cores, target_dir, file_name, yes, download, head, i
379
379
 
380
380
 
381
381
  def _get_sample_result_files_with_names(sample, module_name=None, first=False):
382
+ result_files_with_names = []
382
383
  for read_type, folder in sample.get_all_fastqs().items():
383
384
  if module_name and module_name != read_type:
384
385
  continue
385
- result_files_with_names = []
386
386
  for folder_name, result_files in folder.items():
387
387
  for lane_num, result_file in enumerate(result_files):
388
388
  lane_num = lane_num + 1 # 1 indexed
geoseeq/cli/main.py CHANGED
@@ -55,7 +55,7 @@ def version():
55
55
  Use of this tool implies acceptance of the GeoSeeq End User License Agreement.
56
56
  Run `geoseeq eula show` to view the EULA.
57
57
  """
58
- click.echo('0.6.14dev4') # remember to update pyproject.toml
58
+ click.echo('0.6.14dev6') # remember to update pyproject.toml
59
59
 
60
60
 
61
61
  @main.group('advanced')
@@ -118,11 +118,19 @@ def _is_fastq(path, fq_exts=['.fastq', '.fq'], compression_exts=['.gz', '.bz2',
118
118
  return False
119
119
 
120
120
 
121
- def flatten_list_of_fastqs(filepaths):
121
+ def _is_fasta(path, fa_exts=['.fasta', '.fa'], compression_exts=['.gz', '.bz2', '']):
122
+ for fa_ext in fa_exts:
123
+ for compression_ext in compression_exts:
124
+ if path.endswith(fa_ext + compression_ext):
125
+ return True
126
+ return False
127
+
128
+
129
+ def flatten_list_of_fastxs(filepaths):
122
130
  """Turn a list of fastq filepaths and txt files containing fastq filepaths into a single list of fastq filepaths."""
123
131
  flattened = []
124
132
  for path in filepaths:
125
- if _is_fastq(path):
133
+ if _is_fastq(path) or _is_fasta(path):
126
134
  flattened.append(path)
127
135
  else:
128
136
  with open(path) as f:
@@ -218,7 +226,7 @@ def cli_upload_reads_wizard(state, cores, overwrite, yes, regex, private, link_t
218
226
  """
219
227
  knex = state.get_knex()
220
228
  proj = handle_project_id(knex, project_id, yes, private)
221
- filepaths = {basename(line): line for line in flatten_list_of_fastqs(fastq_files)}
229
+ filepaths = {basename(line): line for line in flatten_list_of_fastxs(fastq_files)}
222
230
  click.echo(f'Found {len(filepaths)} files to upload.', err=True)
223
231
  regex = _get_regex(knex, filepaths, module_name, proj, regex)
224
232
  groups = _group_files(knex, filepaths, module_name, regex, yes)
geoseeq/project.py CHANGED
@@ -170,20 +170,19 @@ class Project(RemoteObject):
170
170
  Alias for result_folder."""
171
171
  return self.result_folder(*args, **kwargs)
172
172
 
173
- def get_samples(self, cache=True, error_handler=None):
173
+ def get_samples(self, cache=True, error_handler=None, fetch=True):
174
174
  """Yield samples fetched from the server."""
175
175
  if cache and self._get_sample_cache:
176
176
  for sample in self._get_sample_cache:
177
177
  yield sample
178
178
  return
179
- url = f"sample_groups/{self.uuid}/samples"
179
+ url = f"sample_groups/{self.uuid}/samples-list?page=1&page_size=100"
180
180
  for sample_blob in paginated_iterator(self.knex, url, error_handler=error_handler):
181
181
  sample = self.sample(sample_blob["name"])
182
- sample.load_blob(sample_blob)
183
- sample.cache_blob(sample_blob)
184
- # We just fetched from the server so we change the RemoteObject
185
- # meta properties to reflect that
186
- sample._already_fetched = True
182
+ sample.uuid = sample_blob["uuid"]
183
+ sample.metadata = sample_blob["metadata"]
184
+ if fetch:
185
+ sample.get()
187
186
  sample._modified = False
188
187
  if cache:
189
188
  self._get_sample_cache.append(sample)
@@ -199,7 +198,7 @@ class Project(RemoteObject):
199
198
  for sample in self._get_sample_cache:
200
199
  yield sample.uuid
201
200
  return
202
- url = f"sample_groups/{self.uuid}/samples"
201
+ url = f"sample_groups/{self.uuid}/samples-list?page=1"
203
202
  for sample_blob in paginated_iterator(self.knex, url, error_handler=error_handler):
204
203
  yield sample_blob['uuid']
205
204
 
@@ -107,7 +107,9 @@ def download_url(url, kind='guess', filename=None, head=None, progress_tracker=N
107
107
  elif kind == 'ftp':
108
108
  return download_ftp(url, filename, head=head)
109
109
  elif kind == 'http':
110
- # for http[s] files we care about head is often respected in practice (e.g. by the ENA)
110
+ # for http[s] files we care about head is often respected in practice (e.g. by the ENA)
111
+ if not url.startswith("http"):
112
+ url = "https://" + url
111
113
  return _download_head(url, filename, head=head, progress_tracker=progress_tracker)
112
114
  else:
113
115
  raise ValueError(f"Unknown download kind: {kind}")
@@ -179,7 +181,7 @@ class ResultFileDownload:
179
181
 
180
182
  url = self.get_download_url()
181
183
  filepath = download_url(
182
- url, blob_type, filename,
184
+ url, kind=blob_type, filename=filename,
183
185
  head=head, progress_tracker=progress_tracker,
184
186
  )
185
187
  if cache and flag_suffix:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: geoseeq
3
- Version: 0.6.14.dev4
3
+ Version: 0.6.14.dev6
4
4
  Summary: GeoSeeq command line tools and python API
5
5
  Author: David C. Danko
6
6
  Author-email: "David C. Danko" <dcdanko@biotia.io>
@@ -7,7 +7,7 @@ geoseeq/file_system_cache.py,sha256=HzVZWtwLD2fjWWSo_UfWmGeBltm9He4lP_OqzKwNGWg,
7
7
  geoseeq/knex.py,sha256=zcjafsmUn9SC3LlRnvvaXpr-pHYZ0IXk7LpzuUoE3MI,8312
8
8
  geoseeq/organization.py,sha256=bJkYL8_D-k6IYAaii2ZbxjwYnXy6lvu6iLXscxKlA3w,2542
9
9
  geoseeq/pipeline.py,sha256=89mhWaecsKnm6tyRkdkaVp4dmZh62_v42Ze0oXf8OTY,9873
10
- geoseeq/project.py,sha256=kN6m1N4Tlud7saU03Sbir-oIBnXet_Cwi2OVVdaeag0,13929
10
+ geoseeq/project.py,sha256=Ba3yvrSyPVnEM5_VGSQu6YPH3CTwE3fHs4JjAepEK7g,13880
11
11
  geoseeq/remote_object.py,sha256=GYN6PKU7Zz3htIdpFjfZiFejzGqqJHbJyKlefM1Eixk,7151
12
12
  geoseeq/sample.py,sha256=HAfMiDPHp1UJgIA2lI6oGnNit4YKyj7nx9X07CCN98U,8316
13
13
  geoseeq/search.py,sha256=gawad6Cx5FxJBPlYkXWb-UKAO-UC0_yhvyU9Ca1kaNI,3388
@@ -20,11 +20,11 @@ geoseeq/cli/__init__.py,sha256=4WnK87K5seRK3SGJAxNWnQTqyg5uBhdhrOrzB1D4b3M,24
20
20
  geoseeq/cli/constants.py,sha256=Do5AUf9lMO9_P8KpFJ3XwwFBAWsxSjZ6sx9_QEGyC_c,176
21
21
  geoseeq/cli/copy.py,sha256=02U9kdrAIbbM8MlRMLL6p-LMYFSuRObE3h5jyvcL__M,2275
22
22
  geoseeq/cli/detail.py,sha256=q8Suu-j2k18knfSVFG-SWWGNsKM-n8y9RMA3LcIIi9Y,4132
23
- geoseeq/cli/download.py,sha256=Aul4Gk49e0Y0R4kH7sD1iJ9SgJDJsrRfXjfRo88-SJE,21309
23
+ geoseeq/cli/download.py,sha256=cOLIVzAfxpOJnSd4WKWR-HCkOrKjPMbgYaNXDSd9i90,21305
24
24
  geoseeq/cli/fastq_utils.py,sha256=-bmeQLaiMBm57zWOF0R5OlWTU0_3sh1JBC1RYw2BOFM,3083
25
25
  geoseeq/cli/find_grn.py,sha256=oMDxkzGQBQb2_cCuvmwoeHOsFHqyO9RLeJzrB6bAe5M,439
26
26
  geoseeq/cli/get_eula.py,sha256=79mbUwyiF7O1r0g6UTxG9kJGQEqKuH805E6eLkPC6Y4,997
27
- geoseeq/cli/main.py,sha256=olfB8IkiY7bO2XbppkWrTdm-PMG0u_jccZk-2Aj0GMM,3987
27
+ geoseeq/cli/main.py,sha256=ufRoSCJh1D5jas9rZO6ypKRHTRh0jL2ET7fXAV5oD2E,3987
28
28
  geoseeq/cli/manage.py,sha256=wGXAcVaXqE5JQEU8Jh6OlHr02nB396bpS_SFcOZdrEo,5929
29
29
  geoseeq/cli/progress_bar.py,sha256=p1Xl01nkYxSBZCB30ue2verIIi22W93m3ZAMAxipD0g,738
30
30
  geoseeq/cli/project.py,sha256=V5SdXm2Hwo2lxrkpwRDedw-mAE4XnM2uwT-Gj1D90VQ,3030
@@ -43,7 +43,7 @@ geoseeq/cli/shared_params/opts_and_args.py,sha256=_DcJ-TqgrbBaeDd-kuHEx2gLZPQN6E
43
43
  geoseeq/cli/upload/__init__.py,sha256=3C9_S9t7chmYU-2ot89NV03x-EtmsjibulErKaU9w1k,627
44
44
  geoseeq/cli/upload/upload.py,sha256=JZkhe1q3KOp7-tKyzwi860TQhZoNDnZs4yB2PJhOjl0,10081
45
45
  geoseeq/cli/upload/upload_advanced.py,sha256=Jq5eGe-wOdrzxGWVwaFPg0BAJcW0YSx_eHEmYjJeKuA,3434
46
- geoseeq/cli/upload/upload_reads.py,sha256=dvmOVq0lJSbpQDyWkNEnZmhkMvfEByV-i8xD75Ai4dA,10706
46
+ geoseeq/cli/upload/upload_reads.py,sha256=Q5gihBmQM9jQx0QSj5qPH8sc8CkVNE1_DD5JradXBdg,10990
47
47
  geoseeq/contrib/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
48
48
  geoseeq/contrib/ncbi/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
49
49
  geoseeq/contrib/ncbi/api.py,sha256=WQeLoGA_-Zha-QeSO8_i7HpvXyD8UkV0qc5okm11KiA,1056
@@ -68,7 +68,7 @@ geoseeq/plotting/map/overlay.py,sha256=4VmxqOESTQra9tPr8b8OLEUhJSit9lNipabeSznEY
68
68
  geoseeq/result/__init__.py,sha256=IFHIyRV8ZzuKIfwfze1SXgcKwNMcSgMAknLHMkwjXIU,356
69
69
  geoseeq/result/bioinfo.py,sha256=QQtbyogrdro9avJSN0713sxLVnVeA24mFw3hWtKDKyw,1782
70
70
  geoseeq/result/file_chunker.py,sha256=bXq1csuRtqMB5sbH-AfWo6gdPwrivv5DJPuHVj-h08w,1758
71
- geoseeq/result/file_download.py,sha256=F0qSlZyrzh7G2R-qxmGwRicTJiojBUbcBN_SWF1sZac,8123
71
+ geoseeq/result/file_download.py,sha256=5IXg_dIWlrRHBJQssO42da5_bIJOyH0_b8K2KWVAFBE,8210
72
72
  geoseeq/result/file_upload.py,sha256=xs1DrI-h4ZP7xN8HPBc3SFpcPAxR5HAolraP1Zu7tvE,10648
73
73
  geoseeq/result/result_file.py,sha256=A2PIdkuNY0czXLXPenSRdUPdCFdjJGGqs3nBOflNwnA,9099
74
74
  geoseeq/result/result_folder.py,sha256=-m1lDVLpNHKy-JUGihboVzvdMJEnHossyRnxmBe1XLo,11140
@@ -87,9 +87,9 @@ geoseeq/vc/vc_stub.py,sha256=IQr8dI0zsWKVAeY_5ybDD6n49_3othcgfHS3P0O9tuY,3110
87
87
  tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
88
88
  tests/test_api_client.py,sha256=TS5njc5pcPP_Ycy-ljcfPVT1hQRBsFVdQ0lCqBmoesU,12810
89
89
  tests/test_plotting.py,sha256=TcTu-2ARr8sxZJ7wPQxmbs3-gHw7uRvsgrhhhg0qKik,784
90
- geoseeq-0.6.14.dev4.dist-info/LICENSE,sha256=IuhIl1XCxXLPLJT_coN1CNqQU4Khlq7x4IdW7ioOJD8,1067
91
- geoseeq-0.6.14.dev4.dist-info/METADATA,sha256=5d01roEOeHuNDH3Jgh2ScJyhc7mdn3JbB2rq32vV90k,4937
92
- geoseeq-0.6.14.dev4.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
93
- geoseeq-0.6.14.dev4.dist-info/entry_points.txt,sha256=yF-6KDM8zXib4Al0qn49TX-qM7PUkWUIcYtsgt36rjM,45
94
- geoseeq-0.6.14.dev4.dist-info/top_level.txt,sha256=zZk7mmeaqAYqFJG8nq2DTgSQPbflRjJwkDIhNURPDEU,14
95
- geoseeq-0.6.14.dev4.dist-info/RECORD,,
90
+ geoseeq-0.6.14.dev6.dist-info/LICENSE,sha256=IuhIl1XCxXLPLJT_coN1CNqQU4Khlq7x4IdW7ioOJD8,1067
91
+ geoseeq-0.6.14.dev6.dist-info/METADATA,sha256=Yg0PM7m43T1S2-aC-vXwJsQ4SDh1JqkUqAbL2qePFBk,4937
92
+ geoseeq-0.6.14.dev6.dist-info/WHEEL,sha256=In9FTNxeP60KnTkGw7wk6mJPYd_dQSjEZmXdBdMCI-8,91
93
+ geoseeq-0.6.14.dev6.dist-info/entry_points.txt,sha256=yF-6KDM8zXib4Al0qn49TX-qM7PUkWUIcYtsgt36rjM,45
94
+ geoseeq-0.6.14.dev6.dist-info/top_level.txt,sha256=zZk7mmeaqAYqFJG8nq2DTgSQPbflRjJwkDIhNURPDEU,14
95
+ geoseeq-0.6.14.dev6.dist-info/RECORD,,