Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pretextgraph #51674

Merged
merged 5 commits into from
Oct 26, 2024
Merged

Conversation

guanshaoheng
Copy link
Contributor

Update PretextGraph to 0.0.7

Fixes and Improvements:

  • Resolved the gap extension issue:
    • Addressed data overflow when calculating graph->values by changing the calculation type from u32 to f32.
    • Introduced a new data_type for handling different methods of transforming the bedgraph file into Graph->values:
      • gap: Sets the pixel value with number index for Graph->values[index] containing the gap to 1.
  • repeat_density: Normalizes the value of each bin as a percentage, reflecting the ratio of repeat pairs within that bin. For instance, if the bin_size=10,000 and N base pairs are marked as repeats, the ratio is calculated as N / 10,000.
  • default: Retains the original calculation method.
  • Fixed a segmentation fault in PrintStatus: Resolved small bugs that caused the program to crash.
  • Improved ProcessLine function: Added a check to ensure (u32) nThisBin does not become negative. Originally, if a negative value is encountered, it will be set to the maximum allowable value for u32. Currently, it will be set as 0.
  • Compilation adjustments: Since modifications were made in C++, the compiler has been switched to Clang++ to resolve compilation issues.

Copy link
Contributor

coderabbitai bot commented Oct 25, 2024

📝 Walkthrough
📝 Walkthrough

Walkthrough

The pull request introduces modifications to two files: build.sh and meta.yaml within the PretextGraph package. In build.sh, the C++ compiler setting has been updated from clang to clang++ for non-Darwin systems, ensuring the correct compiler is used for C++ files while maintaining the overall structure of the script. In meta.yaml, the version number is incremented from "0.0.6" to "0.0.7". The source URL has been altered to point to a new repository, changing from a previous GitHub URL to a new one with a .tar.gz file format. The SHA256 checksum has been updated, and the build number has been reset to 0. Additionally, a new field run_exports has been introduced under the build section, specifying a dependency on the pretextgraph subpackage with a maximum pinning of "x.x". The requirements section remains largely unchanged, with only formatting adjustments to the spacing of the clang and meson dependencies.

Suggested labels

autobump, new version


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 17bee96 and 55cbecd.

📒 Files selected for processing (1)
  • recipes/pretextgraph/meta.yaml (1 hunks)
🚧 Files skipped from review as they are similar to previous changes (1)
  • recipes/pretextgraph/meta.yaml

Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (2)
recipes/pretextgraph/build.sh (1)

Line range hint 1-14: Consider adding error handling for the build process.

While the script uses set -eo pipefail, it would be beneficial to add explicit error handling around the meson commands to provide more informative error messages during build failures.

Consider wrapping the build commands in a function with error handling:

 #!/bin/bash
 
 set -eo pipefail
 
+build_and_install() {
+    if ! meson compile; then
+        echo "Error: Build failed" >&2
+        return 1
+    fi
+    
+    if ! meson test; then
+        echo "Error: Tests failed" >&2
+        return 1
+    fi
+    
+    if ! meson install; then
+        echo "Error: Installation failed" >&2
+        return 1
+    fi
+}
+
 if [ `uname` == Darwin ]; then
     meson setup --buildtype=release --prefix=$PREFIX --unity on builddir
 else
     env CC=clang CXX=clang++ meson setup --buildtype=release --prefix=$PREFIX --unity on builddir
 fi
 
 cd builddir
-meson compile
-meson test
-meson install
+build_and_install
🧰 Tools
🪛 Shellcheck

[warning] 5-5: Quote this to prevent word splitting.

(SC2046)

recipes/pretextgraph/meta.yaml (1)

Line range hint 27-36: Update repository references in about section

The home URL and description still reference the old repository (wtsi-hpag) while the source now points to sanger-tol. Consider updating these references for consistency.

Apply this diff:

-  home: https://github.com/wtsi-hpag/PretextGraph
+  home: https://github.com/sanger-tol/PretextGraph
   description: >
     This is a tool for converting data from a bedgraph format and embedding into a Hi-C contact map in the Pretext format.
     The graph data can then be displayed alongside the contact map using the PretextView desktop software (https://github.com/wtsi-hpag/PretextView).
-    See https://github.com/wtsi-hpag/PretextMap for how to generate Pretext contact maps, or search for pretextmap on bioconda.
+    See https://github.com/sanger-tol/PretextMap for how to generate Pretext contact maps, or search for pretextmap on bioconda.
🧰 Tools
🪛 yamllint

[error] 1-1: syntax error: found character '%' that cannot start any token

(syntax)

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL

📥 Commits

Files that changed from the base of the PR and between 5d9856f and 95e674f.

📒 Files selected for processing (2)
  • recipes/pretextgraph/build.sh (1 hunks)
  • recipes/pretextgraph/meta.yaml (1 hunks)
🔇 Additional comments (3)
recipes/pretextgraph/build.sh (1)

8-8: LGTM! Compiler change aligns with C++ codebase requirements.

The change from clang to clang++ is appropriate given the C++ code modifications mentioned in the PR objectives.

Let's verify the C++ file extensions in the codebase:

✅ Verification successful

Let's verify the PretextGraph repository specifically since the current results show files from various recipes but we need to focus on the PretextGraph codebase.


Let's check the meta.yaml file to see if it references any source code or repository that would confirm the C++ nature of the project.


Compiler change is correct and verified by package requirements

The change from clang to clang++ in build.sh is appropriate because:

  • The meta.yaml explicitly requires a C++ compiler ({{ compiler('cxx') }})
  • The package uses Meson build system which is commonly used for C++ projects
  • The Linux-specific requirement for clang>=9.0.1 indicates C++ compilation needs
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify presence of C++ source files to confirm compiler choice
# Expected: Find .cpp/.cxx/.cc files indicating C++ source code

# Search for C++ source files
echo "Searching for C++ source files..."
fd -e cpp -e cxx -e cc -e hpp -e hxx -e h

# Verify if any files explicitly specify C++ requirements
echo -e "\nChecking for C++ specific features..."
rg -l "class\s+\w+|template\s*<|namespace\s+\w+"

Length of output: 11636


Script:

#!/bin/bash
# Check for C++ files specifically in pretextgraph recipe and its source
echo "Checking PretextGraph source files..."
fd . recipes/pretextgraph -t f

# Look for C++ patterns specifically in PretextGraph files
echo -e "\nChecking for C++ patterns in PretextGraph files..."
rg -l "class\s+\w+|template\s*<|namespace\s+\w+" recipes/pretextgraph/

Length of output: 368


Script:

#!/bin/bash
# Check meta.yaml for source information
echo "Content of meta.yaml:"
cat recipes/pretextgraph/meta.yaml

# Check if build.sh has any other C++ indicators
echo -e "\nChecking build.sh for compiler usage:"
cat recipes/pretextgraph/build.sh

Length of output: 1519

recipes/pretextgraph/meta.yaml (2)

2-2: LGTM: Version bump is appropriate

The version increment to 0.0.7 aligns with the significant changes mentioned in the PR objectives, including data type changes, segmentation fault fixes, and new functionality.


14-14: LGTM: Build number increment is appropriate

The build number increment follows conda packaging best practices.

Comment on lines 9 to 11
git_url: https://github.com/sanger-tol/PretextGraph.git
git_tag: "{{ version }}"
git_submodules: True
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codebase verification

Repository ownership and submodules verified - update needed

The repository does require submodules as evidenced by the .gitmodules file, which shows dependencies on:

However, both repositories (wtsi-hpag/PretextGraph and sanger-tol/PretextGraph) are currently active and independent (not a fork relationship), suggesting a parallel development rather than an ownership transfer. The recipe should maintain the original wtsi-hpag source or clarify the relationship between these repositories.

🔗 Analysis chain

Verify repository ownership transfer and submodule dependencies

The source has been changed from wtsi-hpag releases to sanger-tol git repository. This appears to be an ownership transfer.

Let's verify the repository transfer and submodule requirements:


Let me generate another verification script to check for submodules more accurately and verify the repository relationship:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify repository ownership and submodules

# Test 1: Check if the old repository redirects to the new one
echo "Checking repository transfer:"
gh repo view wtsi-hpag/PretextGraph 2>&1 || true

# Test 2: Verify the existence and accessibility of the new repository
echo -e "\nVerifying new repository:"
gh repo view sanger-tol/PretextGraph

# Test 3: Check for submodules in the repository
echo -e "\nChecking for submodules:"
git ls-remote --recurse-submodules https://github.com/sanger-tol/PretextGraph.git | grep -i modules || echo "No submodules found"

Length of output: 9926


Script:

#!/bin/bash
# Check for .gitmodules file and submodule references
echo "Checking for .gitmodules and submodule configuration:"
git clone --depth 1 https://github.com/sanger-tol/PretextGraph.git temp_repo
cd temp_repo
if [ -f .gitmodules ]; then
    echo "Found .gitmodules file:"
    cat .gitmodules
else
    echo "No .gitmodules file found"
fi

echo -e "\nChecking git config for submodules:"
git config --list | grep -i submodule || echo "No submodule configuration found"

echo -e "\nChecking repository relationship:"
gh api repos/sanger-tol/PretextGraph --jq '.fork, .parent.full_name, .source.full_name' || echo "Not a fork"

cd ..
rm -rf temp_repo

Length of output: 995

@martin-g martin-g merged commit c3e65e2 into bioconda:master Oct 26, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants