Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/dev' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
nleroy917 committed Jul 25, 2024
2 parents f5141ef + 6f08e1b commit d55b28a
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 14 deletions.
10 changes: 7 additions & 3 deletions web/src/components/schemas/schema-list-card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ type Props = {

export const SchemaListCard = (props: Props) => {
const { schema } = props;
const { namespace, name, description, last_update_date } = schema;
const { namespace, name, description, last_update_date, submission_date } = schema;
return (
<div className="border border-dark p-2 shadow-sm rounded mt-3">
<div className="d-flex flex-column gap-1">
Expand All @@ -22,8 +22,12 @@ export const SchemaListCard = (props: Props) => {
</div>
<p className="text-muted mb-0">{description || 'No description'}</p>
<p className="fst-italic mb-0 text-sm">
<i className="bi bi-clock me-1"></i>
{dateStringToDateTime(last_update_date)}
<span className="mx-1">
<i className="bi bi-clock me-1"> Updated: {dateStringToDateTime(last_update_date)}</i>{' '}
</span>
<span className="mx-1">
<i className="bi bi-clock me-1"> Created: {dateStringToDateTime(submission_date)}</i>
</span>
</p>
</div>
</div>
Expand Down
10 changes: 5 additions & 5 deletions web/src/pages/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -136,8 +136,8 @@ export function Home() {
<h2 className="fw-bold">Web server and API</h2>
<p className="text-balance pe-4">
The PEPhub web server and API are designed to provide a user-friendly interface for exploring and
working with biologically ortiented sample metadata. The web server allows users to search for metadata,
view detailed information about these metadata, and create new metadata.
working with biologically oriented sample metadata. The web server allows users to search for metadata,
view detailed information about these metadata, and create projects.
</p>
</Col>
<Col sm={6} md={6} className="d-flex flex-column align-items-center justify-content-center h-100">
Expand Down Expand Up @@ -190,11 +190,11 @@ export function Home() {
<p className="text-balance pe-4">
PEPhub provides a Python an R client for interacting with the PEPhub API. The client allows users to
download and work with project metadata programmatically, without the need to interact with the native
API. <code>peppy</code> is available on PyPI with other useful tools for genomic metadata manipulation.
API. <code>PEPHubClient</code> is available on PyPI with other useful tools for metadata manipulation.
Peppy:{' '}
<a href="https://pypi.org/project/peppy/" className="bi bi-box-fill">
<a href="https://pypi.org/project/pephubclient/" className="bi bi-box-fill">
{' '}
PyPI peppy
PyPI pephubclient
</a>
.
</p>
Expand Down
48 changes: 42 additions & 6 deletions web/src/utils/const.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,10 @@ export const CLIENT_PYTHON_CODE_MD = `
import peppy
project = peppy.Project.from_pephub('databio/example')
# where 'databio/example' is the project registry path
print(project)
for sample in proj.samples:
print(sample)
\`\`\`
`;

Expand All @@ -105,21 +107,50 @@ import peppy
project = peppy.Project.from_pephub('databio/example')
print(project)
for sample in proj.samples:
print(sample)
`;

export const CLIENT_R_CODE_MD = `
\`\`\`r
library(pepr)
# PEPHub client is not yet available in R
# R package is under development
pep <- pullProject('databio/example:default')
for (sample in sampleTable(pep)) {
print(sample)
}
\`\`\`
`;

export const CLIENT_R_CODE_RAW = `
# PEPHub client is not yet available in R
# R package is under development
library(pepr)
pep <- pullProject('databio/example:default')
for (sample in sampleTable(pep)) {
print(sample)
}
`;

export const CLIENT_CLI_CODE_MD = `
\`\`\`bash
phc login
phc pull databio/example:default --zip
\`\`\`
`;

export const CLIENT_CLI_CODE_RAW = `
library(pepr)
pep <- pullProject('databio/example:default')
for (sample in sampleTable(pep)) {
print(sample)
}
`;

export const PEPHUBCLIENT_SNIPPETS = [
Expand All @@ -133,4 +164,9 @@ export const PEPHUBCLIENT_SNIPPETS = [
code: CLIENT_R_CODE_MD,
raw: CLIENT_R_CODE_RAW,
},
{
language: 'CLI',
code: CLIENT_CLI_CODE_MD,
raw: CLIENT_CLI_CODE_RAW,
},
];

0 comments on commit d55b28a

Please sign in to comment.